Class HttpSpanNameExtractorBuilder<REQUEST>

java.lang.Object
io.opentelemetry.instrumentation.api.semconv.http.HttpSpanNameExtractorBuilder<REQUEST>

public final class HttpSpanNameExtractorBuilder<REQUEST> extends Object
A builder of HttpSpanNameExtractor.
Since:
2.0.0
  • Constructor Details

  • Method Details

    • setKnownMethods

      @CanIgnoreReturnValue public HttpSpanNameExtractorBuilder<REQUEST> setKnownMethods(Collection<String> knownMethods)
      Configures the extractor to recognize an alternative set of HTTP request methods.

      By default, this extractor defines "known" methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789. If an unknown method is encountered, the extractor will use the value "_OTHER" instead of it and put the original value in an extra http.request.method_original attribute.

      Note: calling this method overrides the default known method sets completely; it does not supplement it.

      Parameters:
      knownMethods - A set of recognized HTTP request methods.
    • setKnownMethods

      @CanIgnoreReturnValue public HttpSpanNameExtractorBuilder<REQUEST> setKnownMethods(Set<String> knownMethods)
      Configures the extractor to recognize an alternative set of HTTP request methods.

      By default, this extractor defines "known" methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789. If an unknown method is encountered, the extractor will use the value "_OTHER" instead of it and put the original value in an extra http.request.method_original attribute.

      Note: calling this method overrides the default known method sets completely; it does not supplement it.

      Parameters:
      knownMethods - A set of recognized HTTP request methods.
    • build

      public SpanNameExtractor<REQUEST> build()
      Returns a new HttpSpanNameExtractor with the settings of this HttpSpanNameExtractorBuilder.
      See Also: