Skip to content

Conversation

@qihaiyan
Copy link
Contributor

@qihaiyan qihaiyan commented Oct 28, 2025

Description

{% if enabled_plugins["prometheus"] and not enabled_stream_plugins["prometheus"] then %}
    lua_shared_dict prometheus-metrics {* http.lua_shared_dict["prometheus-metrics"] *};
    -- add prometheus-cache here
    lua_shared_dict prometheus-cache {* http.lua_shared_dict["prometheus-cache"] *};
{% end  #%}

Maybe it's better to set prometheus-cache together with prometheus-metrics in ngx_tpl.lua

Only when use_apisix_base is set to true, will the prometheus-cache take effect.
But in order to integrate with QAT, i used a custom built openresty instead of apisix-runtime, so use_apisix_base is not true, and prometheus-cache is not setted in nginx.conf even if prometheus plugin is enabled.

Which issue(s) this PR fixes:

Fixes #12703

Checklist

  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the APISIX mailing list first)

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add additional handling of prometheus-cache in ngx_tpl.lua

1 participant