-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
area-System.Diagnostics.MetricenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additions
Milestone
Description
Currently there is no way to add default tag to a meter and/or instrument. There are scenarios where there are a set of common tags that needs to be applied to a group of metrics (which doesn't apply to all the metrics but a group of metrics). Currently there is no way to add these tags directly to the meter or instrument and the caller needs to pass these tags for every instrument when invoking Add/Record method every time. This limits us in 2 ways
- Every instrument Add/Record call now need to add these tags on these instrument. Consider the cases where all the tags are static so their values don't change but they need to be attached to the metric, or a bigger subset of dimensions are static and need to be added to all the instruments created from a specific meter. (This about a third party library emitting metrics which always wants to add a set of tags to all metrics emitted by this library)
- One can't add a layer and inject additional default tags to instruments once an instrument invokes Add/Record call unless the caller is also implementing the metric listener as well. In the common scenario one would be using existing pipelines like OpenTelemetry metrics pipeline to collect metrics and we would need an ability to attach some default tags to certain instruments
I created an ask on the OpenTelemetry repo as well and it's clear that dotnet runtime is the right place for this feature, so creating one here. Please check the issue on OpenTelemetry repo for one of the actual scenario open-telemetry/opentelemetry-dotnet#4316
MatisseHack
Metadata
Metadata
Assignees
Labels
area-System.Diagnostics.MetricenhancementProduct code improvement that does NOT require public API changes/additionsProduct code improvement that does NOT require public API changes/additions