Skip to content

help request: lua_shared_dict "prometheus-cache" not configured #13588

Description

@IIIThSoul

Description

启动 apisix 报错 lua_shared_dict "prometheus-cache" not configured,配置 nginx_config.http.lua_shared_dict.prometheus-cache 后,依旧如此

相关配置如下:

nginx_config:               

event:
  worker_connections: 10620

# envs:                         # Get environment variables.
#  - TEST_ENV

meta:
  lua_shared_dict:              # Nginx Lua shared memory zone. Size units are m or k.
    prometheus-metrics: 15m
    prometheus-cache: 10m       # Cache the calculated metrics data text.
                                # Please resize when the `error.log` prompts that the data is full.
                                # NOTE: Restart APISIX to take effect.
    standalone-config: 10m
    upstream-healthcheck: 10m

stream:
  enable_access_log: false                 # Enable stream proxy access logging.
  access_log: logs/access_stream.log       # Location of the stream access log.
  access_log_format: |
    "$remote_addr [$time_local] $protocol $status $bytes_sent $bytes_received $session_time" # Customize log format: http://nginx.org/en/docs/varindex.html
  access_log_format_escape: default        # Escape default or json characters in variables.
  lua_shared_dict:                         # Nginx Lua shared memory zone. Size units are m or k.
    etcd-cluster-health-check-stream: 10m
    lrucache-lock-stream: 10m
    plugin-limit-conn-stream: 10m
    worker-events-stream: 10m
    tars-stream: 1m

# Add other custom Nginx configurations.
# Users are responsible for validating the custom configurations
# to ensure they are not in conflict with APISIX configurations.
main_configuration_snippet: |
  # Add custom Nginx main configuration to nginx.conf.
  # The configuration should be well indented!
http_configuration_snippet: |
  # Add custom Nginx http configuration to nginx.conf.
  # The configuration should be well indented!
http_server_configuration_snippet: |
  # Add custom Nginx http server configuration to nginx.conf.
  # The configuration should be well indented!
http_server_location_configuration_snippet: |
  # Add custom Nginx http server location configuration to nginx.conf.
  # The configuration should be well indented!
http_admin_configuration_snippet: |
  # Add custom Nginx admin server configuration to nginx.conf.
  # The configuration should be well indented!
http_end_configuration_snippet: |
  # Add custom Nginx http end configuration to nginx.conf.
  # The configuration should be well indented!
stream_configuration_snippet: |
  # Add custom Nginx stream configuration to nginx.conf.
  # The configuration should be well indented!

http:
  enable_access_log: true             # Enable HTTP proxy access logging.
  access_log: logs/access.log         # Location of the access log.
  access_log_buffer: 16384            # buffer size of access log.
  # available variables:
  # request_type: traditional_http / ai_chat / ai_stream
  # llm_time_to_first_token: duration from the start send request to ai server to the first token received
  # llm_prompt_tokens: number of tokens in the prompt
  # llm_completion_tokens: number of tokens in the chat completion
  access_log_format: |
    "$remote_addr - $remote_user [$time_local] $http_host \"$request\" $status $body_bytes_sent $request_time \"$http_referer\" \"$http_user_agent\" $upstream_addr $upstream_status $upstream_response_time \"$upstream_scheme://$upstream_host$upstream_uri\""
  # Customize log format: http://nginx.org/en/docs/varindex.html
  access_log_format_escape: default   # Escape default or json characters in variables.
  keepalive_timeout: 60s              # Set the maximum time for which TCP connection keeps alive.
  client_header_timeout: 60s          # Set the maximum time waiting for client to send the entire HTTP
                                      # request header before closing the connection.
  client_body_timeout: 60s            # Set the maximum time waiting for client to send the request body.
  client_max_body_size: 100m             # Set the maximum allowed size of the client request body.
                                      # Default to 0, unlimited.
                                      # Unlike Nginx, APISIX does not limit the body size by default.
                                      # If exceeded, the 413 (Request Entity Too Large) error is returned.
  send_timeout: 30s                   # Set the maximum time for transmitting a response to the client before closing.
  underscores_in_headers: "on"        # Allow HTTP request headers to contain underscores in their names.
  real_ip_header: X-Real-IP           # https://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_header
  real_ip_recursive: "off"            # http://nginx.org/en/docs/http/ngx_http_realip_module.html#real_ip_recursive
  real_ip_from:                       # http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from
    - 127.0.0.1
    - "unix:"

  # custom_lua_shared_dict:     # Custom Nginx Lua shared memory zone for nginx.conf. Size units are m or k.
  #  ipc_shared_dict: 100m      # Custom shared cache, format: `cache-key: cache-size`

  proxy_ssl_server_name: true   # Send the server name in the SNI extension when establishing an SSL/TLS
                                # connection with the upstream server, allowing the upstream server to
                                # select the appropriate SSL/TLS certificate and configuration based on
                                # the requested server name.

  upstream:
    keepalive: 320              # Set the maximum time of keep-alive connections to the upstream servers.
                                # When the value is exceeded, the least recently used connection is closed.
    keepalive_requests: 1000    # Set the maximum number of requests that can be served through one
                                # keep-alive connection.
                                # After the maximum number of requests is made, the connection is closed.
    keepalive_timeout: 60s      # Set the maximum time for which TCP connection keeps alive.
  charset: utf-8                # Add the charset to the "Content-Type" response header field.
                                # See http://nginx.org/en/docs/http/ngx_http_charset_module.html#charset
  variables_hash_max_size: 2048 # Set the maximum size of the variables hash table.

  lua_shared_dict:              # Nginx Lua shared memory zone. Size units are m or k.
    internal-status: 10m
    plugin-limit-req: 10m
    plugin-limit-count: 10m
    prometheus-cache: 25m
    prometheus-metrics: 15m     # In production, less than 50m is recommended
    plugin-limit-conn: 10m
    worker-events: 10m
    lrucache-lock: 10m
    balancer-ewma: 10m
    balancer-ewma-locks: 10m
    balancer-ewma-last-touched-at: 10m
    plugin-limit-req-redis-cluster-slot-lock: 1m
    plugin-limit-count-redis-cluster-slot-lock: 1m
    plugin-limit-conn-redis-cluster-slot-lock: 1m
    tracing_buffer: 10m
    plugin-api-breaker: 10m
    etcd-cluster-health-check: 10m
    discovery: 1m
    jwks: 1m
    introspection: 10m
    access-tokens: 1m
    ext-plugin: 1m
    tars: 1m
    cas-auth: 10m
    ocsp-stapling: 10m
    mcp-session: 10m

Environment

  • APISIX version (run apisix version): 3.16.0
  • Operating system (run uname -a): Linux localhost 3.10.0-1160.el7.x86_64 change: added doc of how to load plugin. #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • OpenResty / Nginx version (run openresty -V or nginx -V): openresty/1.31.1.1
  • etcd version, if relevant (run curl http://127.0.0.1:9090/v1/server_info): 3.6.12
  • APISIX Dashboard version, if relevant:
  • Plugin runner version, for issues related to plugin runners:
  • LuaRocks version, for installation issues (run luarocks --version):

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionlabel for questions asked by users

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    📋 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions