-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(prometheus): disable features when plugin is turned off #11047
Conversation
… disabling, remove obsolete tests
… the wrong judgment
apisix/cli/ngx_tpl.lua
Outdated
|
||
{% else %} | ||
|
||
init_by_lua_block { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this block is for
stream
only, please take care of thehttp
- init_by_lua_block should be kept
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- this block is for
stream
only, please take care of thehttp
- init_by_lua_block should be kept
Hi. I have made a corresponding modification based on your two modification opinions
@motongxue Please fix the lint checks. |
Could you add test cases to cover this? |
t/xrpc/prometheus2.t
Outdated
location /t { | ||
content_by_lua_block { | ||
local plugin = require("apisix.plugins.prometheus") | ||
local ok, err = plugin.check_schema({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you add this test case?
t/xrpc/prometheus2.t
Outdated
- limit-count | ||
--- request | ||
GET /apisix/prometheus/metrics | ||
--- error_code: 404 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you only need to add this test case into the existing test cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, I will do it according to your suggestions, although existing test case (t/xprc/prometheus.t) I can't test it in my local development environment.
@motongxue Can you address the failing CI? |
|
Description
The Prometheus plugin is a crucial component for observability within Apache APISIX. However, I've encountered an issue where, even after the Prometheus plugin is disabled, all features related to Prometheus are not entirely shut down. This behavior could lead to unexpected performance impacts and data leakage.
When the Prometheus plugin is disabled, all functionalities and metrics associated with Prometheus should be completely deactivated to ensure no unnecessary overhead or data exposure.
Fixes # (issue)
Checklist