Interface SpanLinkExtractor<REQUEST>

  • Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    @FunctionalInterface
    public interface SpanLinkExtractor<REQUEST>
    Extractor of a span link for a request.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      io.opentelemetry.api.trace.SpanContext extract​(io.opentelemetry.context.Context parentContext, REQUEST request)
      Extract a SpanContext that should be linked to the newly created span.
      static <REQUEST> SpanLinkExtractor<REQUEST> fromUpstreamRequest​(io.opentelemetry.context.propagation.ContextPropagators propagators, io.opentelemetry.context.propagation.TextMapGetter<REQUEST> getter)
      Returns a new SpanLinkExtractor that will extract a SpanContext from the request using configured propagators.
    • Method Detail

      • extract

        io.opentelemetry.api.trace.SpanContext extract​(io.opentelemetry.context.Context parentContext,
                                                       REQUEST request)
        Extract a SpanContext that should be linked to the newly created span. Returning SpanContext.getInvalid() will not add any link to the span.
      • fromUpstreamRequest

        static <REQUEST> SpanLinkExtractor<REQUEST> fromUpstreamRequest​(io.opentelemetry.context.propagation.ContextPropagators propagators,
                                                                        io.opentelemetry.context.propagation.TextMapGetter<REQUEST> getter)
        Returns a new SpanLinkExtractor that will extract a SpanContext from the request using configured propagators.