opentelemetry-java-instrumentation icon indicating copy to clipboard operation
opentelemetry-java-instrumentation copied to clipboard

Dropwizard Metric name to attributes transformer

Open philsttr opened this issue 1 year ago • 2 comments

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

philsttr avatar Dec 11 '23 14:12 philsttr

@philsttr In the otel world, what is the mechanism for one to supply a custom/pluggable name/attribute customizer (similar to the newrelic one)?

Looking into other examples, it seems like one can only configure basic settings through AgentInstrumentationConfig (eg, in Micrometer)

I'm interested in contributing for this issue.

ryanprayogo avatar Aug 23 '24 02:08 ryanprayogo

Since there has been no activity on this enhancement for the past year we are closing it to help maintain our backlog. Anyone who would like to work on it is still welcome to do so, and we can re-open it at that time.

github-actions[bot] avatar Sep 29 '25 23:09 github-actions[bot]