open-telemetry / open-telemetry/opentelemetry-java-instrumentation

Making "methods" instrumentation dynamically updateable

Open
#15,228 10 comments 0 reactions 1 assignee View on GitHub

@jackshirazi is already working on this.

Since Jan 16, 2026.

enhancement needs triage
Dominant language
Java
Stars
2.6k
Forks
1.2k
Avg merge
2d 18h
Merged PRs (30d)
228

Description

Is your feature request related to a problem? Please describe.

An API that let's the methods instrumentation have methods instrumented at runtime, and also have any existing method instrumentation disabled at runtime
Conceptually, I think 3 API methods, like

  • listCurrentInstrumentedMethods
  • instrumentMethod(class, method, maybe spankind)
  • disableInstrumentedMethod(class, method)
Describe the solution you'd like

Ideally it's just changes in the method instrumentation. But it would need to be accessible from an extension, which means that I think I need to add an interface to the javaagent-bootstrap module, and I'm not sure how acceptable that is. Or are there other ways to make the internal APIs available externally?

Describe alternatives you've considered

An alternative is to reimplement the full instrumentation as an extension and only have that dyamically updateable, leaving the existing one static and using the env var to determine which methods were instrumented so that the new one doesn't try to duplicate instrumentation on those. In some ways, this is the cleaner option, even though it's duplication of code

Additional context

part of https://github.com/open-telemetry/opentelemetry-java-contrib/issues/2416

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.