8000 [ENHANCEMENT] Alerts: remove metrics for removed Alertmanagers by bboreham · Pull Request #13909 · prometheus/prometheus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[ENHANCEMENT] Alerts: remove metrics for removed Alertmanagers #13909

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

Merged
merged 4 commits into from
Sep 26, 2024

Conversation

bboreham
Copy link
Member
@bboreham bboreham commented Apr 9, 2024

So they don't continue to report stale values.

Fixes #6864

So they don't continue to report stale values.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@beorn7
Copy link
Member
beorn7 commented Apr 9, 2024

For the general context (see also #6864): The traditional orthodox view would be that a program should avoid changing the metrics it exposes over its runtime. However, for programs with higher complexity, we have routinely deregistered or deleted metrics that aren't used anymore. If you partition metrics by backend, and your backends have high churn, you can accumulate a lot of "dead" metrics. I think in the current state of affairs, it is fine to delete those metrics.

What do you all think?

The code changed here is ancient, BTW. Let's page old-hands like @juliusv and @roidelapluie , but anyone else, please chime in if you have an opinion.

bboreham added 2 commits April 9, 2024 16:33
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
@beorn7
Copy link
Member
beorn7 commented Apr 9, 2024

I see. Thank you for the updated PR. I guess it will work now. But adding a test would be better, of course.

Copy link
Member
@machine424 machine424 left a comment

Choose a reason for hiding this comment

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

Plus we already do the same in other managers: https://github.com/search?q=repo%3Aprometheus%2Fprometheus%20DeleteLabelValues&type=code

Maybe we can add some checks using client_golang/prometheus/testutil in existing reload tests.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
Copy link
Member
@machine424 machine424 left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@github-actions github-actions bot added the stale label Sep 15, 2024
@machine424
Copy link
Member

I think this one can be merged.

@github-actions github-actions bot removed the stale label Sep 22, 2024
Copy link
Member
@juliusv juliusv left a comment

Choose a reason for hiding this comment

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

Yeah, I think this is fine to merge as well. 👍

@juliusv
Copy link
Member
juliusv commented Sep 23, 2024

@bboreham Gonna leave it up to you to do the final merge, just because it's been sitting here for a while and I want to make sure you're still happy with it all as well.

@bboreham bboreham merged commit 5710ddf into prometheus:main Sep 26, 2024
25 checks passed
@bboreham bboreham deleted the remove-alertmanager-metrics branch September 26, 2024 14:32
julienduchesne pushed a commit to julienduchesne/prometheus that referenced this pull request Dec 13, 2024
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.

Stale metrics for prometheus_notifications_sent_total
4 participants
0