-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[API Proposal]: Allow to delete an instrument inside a Meter instance #83822
Comments
I would think that having |
Hey there, Do you have any news on top of that matter ? Best regards, |
@LGouellec could you elaborate what kinds of use cases this would be used with? I tend to agree with your proposal but I'm curious to understand what scenario you have that requires removing instruments dynamically like this. |
I work on this open source project , a .Net Kafka Streams implementation. So when the partition is reassigned, I need to drop the instrument in the app A to avoid incoherent monitoring. Let me know, if you have any further questions. |
My team is also interested in such a feature. We would like our application to begin collecting specific metrics from a gauge given a condition. Then once the condition is no longer met, stop the instrument from reporting. It doesn't make sense to destroy the entire meter and re-register all the instruments. The OpenTelemetery Metrics API docs describe this as a requirement (you can look at any of the asynchronous instruments). |
@BrannanKovachev upvote the original post to signal that if you can. |
I've been exploring the new Meter features with a view to replacing the Prometheus.net exporter. The lack of remove/delete for expired instruments is currently a blocker for adoption, so I think this feature would be really useful. My use case is to track equipment with intermittent availability, when the source goes offline I don't want the old metrics hanging around. Tearing down the entire meter every few seconds seems like overkill, as there are some instruments that I don't want to drop. |
For you information, the way that we can't delete a specific metrics force me to |
Any change that it will be part of 10.0 milestone ? |
I can't answer to that as I'm not part of the .NET team @LGouellec , but I hope it does. |
Background and motivation
For now, when you create an instance of Meter you can create multiple types of instrument (Histogram, Counter, ObservableGauge or ObservableCounter).
But you can't delete one observable gauge (for instance) previously created. The only way is to dispose the Meter instance and recreate from scratch with all instruments minus the instrument supposed to remove. It's not efficient at all.
API Proposal
API Usage
Alternative Designs
No response
Risks
No response
The text was updated successfully, but these errors were encountered: