question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: How to disable all instrumentation libraries except for specific ones

See original GitHub issue

Hello,

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:closed
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
moadicommented, Mar 31, 2022

@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.

1reaction
moadicommented, Mar 30, 2022

got it - thanks again for your help!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to suppress opentelemetry java auto instrumentation for ...
You can use the following approach to suppress the quartz instrumentation: -Dotel.instrumentation.quartz.enabled=false.
Read more >
Relic Solution: How to disable any or all instrumentation or ...
One of the easiest steps to take to check the impact instrumentation is having on an application is to disable specific (or all)...
Read more >
Allow to unregister/stop/destroy instruments #2232 - GitHub
I'm currently working on the micrometer->OTel bridge instrumentation in the javaagent. Micrometer offers the possibility to remove a meter ...
Read more >
Carlos Alberto Cortez & Alex Boten, LightStep - YouTube
OpenTelemetry Auto- Instrumentation Deep Dive - Carlos Alberto Cortez & Alex Boten, LightStep. Watch later. Share. Copy link.
Read more >
3.12 Program Instrumentation Options
You can use the function attribute no_instrument_function to suppress profiling of individual functions when compiling with these options. See Common Function ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found