Question: How to disable all instrumentation libraries except for specific ones
See original GitHub issueHello,
We’re using the otel java agent in our services for exporting traces to Jaeger, and would like to reduce some of the startup overhead we’re seeing after enabling this agent. In particular, we are noticing that having the agent specified during launch causes our jetty initialization to be deferred by anywhere from 10-15+ seconds.
[otel.javaagent 2022-03-30 18:48:06:958 +0000] [main] INFO io.opentelemetry.javaagent.tooling.VersionLogger - opentelemetry-javaagent - version: 1.11.1
2022-03-30 18:48:22.084:INFO::main: Logging initialized @16097ms to org.eclipse.jetty.util.log.StdErrLog
whereas without it:
2022-03-30 18:47:42.724:INFO::main: Logging initialized @1116ms to org.eclipse.jetty.util.log.StdErrLog
This caused all sorts of problems for us initially due to the delayed startup caused pod readiness in k8s to take longer leading to slow(er) autoscaling.
Upon adding the -Dotel.javaagent.debug=true
flag to the agent, we notice that the overhead seems to be coming from loading ALL the supported instrumentation classes.
Now, we only want to enable the instrumentation for a handful of libraries, not everything. Reading this page makes it seem like we’ll have to instead have a long list of instrumentation to disable instead?
Combining -Dotel.javaagent.enabled=false (disable all)
with -Dotel.instrumentation.[name].enabled=true
doesn’t seem to work as it disables the agent entirely.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
@trask I forgot to address your comment about the update on startup time improvements.
We’ll be making this change for our deployment pipeline next week and should have some data around improvements after enabling our desired instrumentations.
got it - thanks again for your help!