open-telemetry / opentelemetry-java

OpenTelemetry Java SDK
https://opentelemetry.io
Apache License 2.0
1.95k stars 805 forks source link

Agent limits metric name length to 63 #5656

Closed tomilchik closed 1 year ago

tomilchik commented 1 year ago

Description OTEL Agent 1.28.0 applies rule "metric name not to exceed 63 characters" and drops metrics (does not push them to Collector) that break this rule.

Steps to reproduce Build a Java web app that uses Spring Security 6.*. Attach OTEL Agent v1.24.0+. Call app's http endpoint (any) to trigger execution of Spring Security filter chain.

What did you expect to see? No WARN logs from OTEL Agent re: length of metric names

What did you see instead? Observed: WARN entries in app log similar to this: [otel.javaagent ] WARN io.opentelemetry.sdk.metrics.internal.InstrumentNameValidator - Instrument name "spring.security.filterchain.WebAsyncManagerIntegrationFilter.after" is invalid, returning noop instrument. Instrument names must consist of 63 or fewer characters including alphanumeric, _, -, -, and start with a letter"

What version and what artifacts are you using? Artifacts:

How did you reference these artifacts? (excerpt from your build.gradle, pom.xml, etc) As dependency in pom.xml

Environment Compiler: java 17.0.6 2023-01-17 LTS OS: RHEL 8.8 Runtime (if different from JDK above): same as compiler OS (if different from OS compiled on): same

Additional context After inet searches - the number 63 looks to come from OTEL spec: https://opentelemetry.io/docs/specs/otel/metrics/api/ So - this might be considered "a feature, not a bug". If that is the case: please count my vote for increasing this number in the OTEL implementation (against the spec); the number is 1)arbitrary, and 2)too low. Non-OTEL metric collection implementations (e.g. metrics scraped from Spring Boot actuator/prometheus and delivered to a Prometheus instance with Grafana UI on top) do not seem to have this limitation, at least not at 63.

trask commented 1 year ago

see https://github.com/open-telemetry/opentelemetry-specification/issues/3422

we are hoping to get this restriction lifted

tomilchik commented 1 year ago

That's a good news! Any estimates on when/version?

trask commented 1 year ago

sorry, no

jkwatson commented 1 year ago

closing this, as it's not an issue we can address without a spec change.