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

why is there no del method for histogram types #165

Closed
monkeyDluffy6017 opened this issue Jan 11, 2024 · 1 comment
Closed

why is there no del method for histogram types #165

monkeyDluffy6017 opened this issue Jan 11, 2024 · 1 comment

Comments

@monkeyDluffy6017
Copy link

monkeyDluffy6017 commented Jan 11, 2024

The counter and gauge has del method, however the histogram doesn't have one, how can i delete a particular metric that are histogram?

@knyar
Copy link
Owner

knyar commented Jan 14, 2024

The primary reason is because deletion does not happen atomically, and deleting histogram counters will race with metric collection, potentially resulting in inconsistent data being scraped by prometheus, with some counters that are part of the histogram metric being present, but some already deleted.

I am open to contributions that aim to address this. Incrementing histogram counters is also racey with metric collection, which was the reason behind #161. If you have ideas on improving this and time to implement them, I'd be happy to discuss them and review the PR(s).

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

No branches or pull requests

2 participants