feat: support expire prometheus metrics#10869
Merged
juststillthinking merged 5 commits intoFeb 18, 2024
Merged
Conversation
juststillthinking
marked this pull request as draft
January 25, 2024 12:53
Contributor
|
LGTM! |
moonming
reviewed
Jan 29, 2024
| # - 100 | ||
| # - 200 | ||
| # - 500 | ||
| # expire: 86400 # the expiration time after metrics become inactive, unit: second |
Member
There was a problem hiding this comment.
Default value should be 0 to keep the same strategy as before, no expiration time
Contributor
|
👍 |
juststillthinking
marked this pull request as ready for review
February 6, 2024 10:16
membphis
reviewed
Feb 8, 2024
AlinsRan
approved these changes
Feb 18, 2024
|
@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. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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