Annotation Type AddingSpanAttributes


@Target({METHOD,CONSTRUCTOR}) @Retention(RUNTIME) public @interface AddingSpanAttributes
This annotation marks that an execution of this method or constructor is able to add attributes to the current span Span.

Application developers can use this annotation to signal OpenTelemetry auto-instrumentation that attributes annotated with the SpanAttribute should be detected and added to the current span.

If no span is currently active no new span will be created, and no attributes will be extracted.

Similar to Span.setAttribute() methods, if the key is already mapped to a value the old value is replaced by the extracted value.

If you are a library developer, then probably you should NOT use this annotation, because it is non-functional without some form of auto-instrumentation.