This documentation has an index for AI agents at /llms.txt. A Markdown version of this page is available at https://explorer.opentelemetry.io/java-agent/instrumentation/external-annotations.md.

External Annotations

OpenTelemetry Java agent instrumentation

The external-annotations instrumentation acts as a "shim" that automatically instruments methods annotated with custom or third-party tracing annotations. This is particularly useful if you have existing annotations (such as a custom @Trace or third-party annotation) that you want to leverage with OpenTelemetry. At runtime, this module recognizes those annotations and applies the appropriate OpenTelemetry instrumentation logic, including span creation and context propagation. Covers many common vendor annotations by default, and additional annotations can be targeted using the configuration property "otel.instrumentation.external-annotations.include".

  • Name: external-annotations
  • Scope: io.opentelemetry.external-annotations
  • Target versions: Java 8+

Configuration

OptionTypeDefaultDescription
otel.instrumentation.external-annotations.exclude-methodsstringAll methods to be excluded from auto-instrumentation by annotation-based advices.
otel.instrumentation.external-annotations.includelistSemicolon-separated list of annotation class names to instrument.

Data

  • JSON: /data/javaagent/instrumentations/external-annotations/external-annotations-7035fb1d7faf.json
  • Explore: /java-agent/instrumentation/external-annotations