opentelemetry-java-instrumentation
opentelemetry-java-instrumentation copied to clipboard
Dropwizard Metric name to attributes transformer
Is your feature request related to a problem? Please describe.
DropWizard Metrics does not natively support tags/attributes.
However, a common workaround for users of DropWizard Metrics is to encode tag name/value pairs in the metric name. For example, have a DropWizard Metric with the following name:
metricName[tag:value,othertag:othervalue]
Unfortunately, the OpenTelemetry DropWizard instrumentation uses the DropWizard metric name as-is, and does not provide a mechanism to decode the metric name into name + attributes. This produces low-quality data, which is why the dropwizard-metrics instrumentation is disabled by default.
Describe the solution you'd like
It would be nice if the OpenTelemetry DropWizard Metrics instrumentation had pluggable support for decomposing DropWizard Metric names into name + attributes. Otel could also provide some out-of-the-box implementations for common encodings such as the one mentioned in the example above.
For comparison, this approach has been implemented in dropwizard-metrics-newrelic.
This solution would allow applications currently instrumented with DropWizard metrics with names containing encoded tag name/values to be able to report these metrics via OpenTelemetry, and produce high quality data.
Describe alternatives you've considered
None, other than not using DropWizard Metrics
Additional context
No response