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 <[email protected]> Signed-off-by: ARAYN7011 <[email protected]>
|
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 <[email protected]>
|
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. |
|
@ARAYN7011 @froque are we good? |
|
looks good to me |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4050 +/- ##
============================================
- Coverage 94.22% 94.21% -0.02%
- Complexity 6694 6702 +8
============================================
Files 432 432
Lines 20964 20978 +14
Branches 2108 2113 +5
============================================
+ Hits 19754 19764 +10
- Misses 757 759 +2
- Partials 453 455 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
jknack
left a comment
There was a problem hiding this comment.
one comment. It would be good if we can keep coverage metrics
| * variable or in the {@code otel} block of the application configuration. | ||
| */ | ||
| private boolean isRuntimeTelemetryEnabled(Jooby application) { | ||
| var value = System.getProperty(RUNTIME_TELEMETRY_ENABLED); |
There was a problem hiding this comment.
system env and properties are merged into application configuration, read once from configuration: https://github.com/jooby-project/jooby/blob/main/jooby/src/main/java/io/jooby/Environment.java#L292
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.