-
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
feat: support expire prometheus metrics #10869
feat: support expire prometheus metrics #10869
Conversation
LGTM! |
conf/config-default.yaml
Outdated
# default_buckets: | ||
# - 10 | ||
# - 50 | ||
# - 100 | ||
# - 200 | ||
# - 500 | ||
# expire: 86400 # the expiration time after metrics become inactive, unit: second |
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.
Default value should be 0 to keep the same strategy as before, no expiration time
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.
Done
👍 |
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.
LGTM
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.
LGTM
@monkeyDluffy6017 Hello, if I want to fix this issue in version 3.2.2 of APISIX, can I make the changes according to the code in this link (https://github.com/apache/apisix/pull/10869/files), or can I directly replace the prometheus/exporter.lua file? Looking forward to your reply. |
Description
The prometheus metrics we record are stored in LRUs, and although there is no memory leakage, the metrics are not eliminated until they reach the upper limit of the LRUs. As the metrics become more and more numerous, the prometheus server consumes more and more CPU when pulling data, and a mechanism is needed to eliminate the outdated data.
Fixes #9627
Checklist