Class HttpSpanNameExtractor<REQUEST>

java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanNameExtractor<REQUEST>
All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>

public final class HttpSpanNameExtractor<REQUEST> extends Object implements io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>
Extractor of the HTTP span name. Instrumentation of HTTP server or client frameworks should use this class to comply with OpenTelemetry HTTP semantic conventions.
  • Method Details

    • create

      public static <REQUEST> io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST> create(HttpCommonAttributesGetter<REQUEST,?> getter)
      Returns a SpanNameExtractor which should be used for HTTP requests with default configuration. HTTP attributes will be examined to determine the name of the span.
    • builder

      public static <REQUEST> HttpSpanNameExtractorBuilder<REQUEST> builder(HttpCommonAttributesGetter<REQUEST,?> getter)
      Returns a new HttpSpanNameExtractorBuilder that can be used to configure the HTTP span name extractor.
    • extract

      public String extract(REQUEST request)
      Specified by:
      extract in interface io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>