Repository navigation
Conversation
RuntimeTelemetry was always created, so JVM metrics could not be muted and duplicated those of the OpenTelemetry Java agent. Skip it when the standard property is false (system property, env var or otel config). Fixes jooby-project#4047 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: ARAYN7011 <88572149+ARAYN7011@users.noreply.github.com>
|
This does not fix the duplication of metrics |
|
You're right, thanks. The first commit only made the property work. It didn't remove the duplicate, because I pushed f424a49. I checked it with your repro (agent 2.34.0, logging exporter) and counted the instrumentation scopes that export metrics:
I added unit tests for the agent-present case and the no-agent case, and |
…s present The agent already registers JVM runtime metrics, so installing the module duplicated every jvm.* metric (refs jooby-project#4047). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Correction to my comment above: the commit hadn't been created yet, so the SHA I quoted was the old one. The fix is now pushed as ec7e21b. The rest of the comment stands. |
Fixes #4047
OtelModule.installalways calledRuntimeTelemetry.create(otel), so JVM metrics could not be muted with the standardotel.instrumentation.runtime-telemetry.enabled=falseand were duplicated when the OpenTelemetry Java agent is used.Changes:
falseas a system property, as theOTEL_INSTRUMENTATION_RUNTIME_TELEMETRY_ENABLEDenv var, or in theotelblock of the application config.runtime-telemetryandruntime-telemetry-java8scopes.Test plan:
OtelModuleTesttests: default registers, system property disables, config disables, agent present skips, agent absent detected.mvn -pl modules/jooby-opentelemetry -am test -Dtest='Otel*Test'passes.runtime-telemetryandruntime-telemetry-java8scopes. This branch exports only the agent's.AI assistance: prepared with Claude Code (Claude Sonnet 5.5); I reviewed the change and ran the tests.