-
Notifications
You must be signed in to change notification settings - Fork 981
Allow to unregister/stop/destroy instruments #2232
Copy link
Copy link
Open
Labels
spec:metricsRelated to the specification/metrics directoryRelated to the specification/metrics directorytriage:accepted:ready-with-sponsorReady to be implemented and has a specification sponsor assignedReady to be implemented and has a specification sponsor assigned
Milestone
Metadata
Metadata
Assignees
Labels
spec:metricsRelated to the specification/metrics directoryRelated to the specification/metrics directorytriage:accepted:ready-with-sponsorReady to be implemented and has a specification sponsor assignedReady to be implemented and has a specification sponsor assigned
Type
Fields
Give feedbackNo fields configured for issues without a type.
Projects
Status
Spec - Accepted
What are you trying to achieve?
I'm currently working on the micrometer->OTel bridge instrumentation in the javaagent. Micrometer offers the possibility to remove a meter from the
MeterRegistryand stop emitting whatever metrics it used to collect. For example, suppose you use a database connection pool that's instrumented with metrics - when you close/destroy the whole pool you probably want to stop collecting any metrics associated to it (because it doesn't exist anymore). This is useful for both asynchronous instruments (since once they're registered there's no way to stop them) and synchronous instruments (you can just stop using them, but the metrics SDK will still send in the last recorded value).Additional context.
Micrometer bridge PR: open-telemetry/opentelemetry-java-instrumentation#4919
CC @jsuereth