Class HttpServerRouteBuilder<REQUEST>

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

public final class HttpServerRouteBuilder<REQUEST> extends Object
A builder of HttpServerRoute.
Since:
2.0.0
  • Method Details

    • setKnownMethods

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

      By default, this customizer defines "known" methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789. If an unknown method is encountered, the customizer will use the value "_OTHER" instead.

      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 HttpServerRouteBuilder<REQUEST> setKnownMethods(Set<String> knownMethods)
      Configures the customizer to recognize an alternative set of HTTP request methods.

      By default, this customizer defines "known" methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789. If an unknown method is encountered, the customizer will use the value "_OTHER" instead.

      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 ContextCustomizer<REQUEST> build()
      Returns a ContextCustomizer that initializes an HttpServerRoute in the Context returned from Instrumenter.start(Context, Object). The returned customizer is configured with the settings of this HttpServerRouteBuilder.
      See Also: