Skip to content
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 #11103

Closed
wants to merge 5 commits into from
Closed

fix(prometheus): disable features when plugin is turned off #11103

wants to merge 5 commits into from

Conversation

motongxue
Copy link
Contributor

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

  • 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)

@@ -184,8 +185,9 @@ function batch_processor:push(entry)
return
end

if prometheus and prometheus.get_prometheus() and not batch_metrics and self.name
and self.route_id and self.server_addr then
if not plugin.check_disable_with_metatable(plugin.get("prometheus"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your PR doesn't make sense, the existing logic is just as same as yours.

@shreemaan-abhishek
Copy link
Contributor

I will close this and create a PR myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants