Class AttributePropagatingSpanProcessor

java.lang.Object
io.opentelemetry.contrib.awsxray.AttributePropagatingSpanProcessor
All Implemented Interfaces:
io.opentelemetry.sdk.trace.SpanProcessor, Closeable, AutoCloseable

@Immutable public final class AttributePropagatingSpanProcessor extends Object implements io.opentelemetry.sdk.trace.SpanProcessor
AttributePropagatingSpanProcessor handles the propagation of attributes from parent spans to child spans, specified in attributesKeysToPropagate. AttributePropagatingSpanProcessor also propagates the parent span name to child spans, as a new attribute specified by spanNamePropagationKey. Span name propagation only starts from local root server/consumer spans, but from there will be propagated to any descendant spans.
  • Method Details

    • create

      public static AttributePropagatingSpanProcessor create(io.opentelemetry.api.common.AttributeKey<String> spanNamePropagationKey, List<io.opentelemetry.api.common.AttributeKey<String>> attributesKeysToPropagate)
    • onStart

      public void onStart(io.opentelemetry.context.Context parentContext, io.opentelemetry.sdk.trace.ReadWriteSpan span)
      Specified by:
      onStart in interface io.opentelemetry.sdk.trace.SpanProcessor
    • isStartRequired

      public boolean isStartRequired()
      Specified by:
      isStartRequired in interface io.opentelemetry.sdk.trace.SpanProcessor
    • onEnd

      public void onEnd(io.opentelemetry.sdk.trace.ReadableSpan span)
      Specified by:
      onEnd in interface io.opentelemetry.sdk.trace.SpanProcessor
    • isEndRequired

      public boolean isEndRequired()
      Specified by:
      isEndRequired in interface io.opentelemetry.sdk.trace.SpanProcessor