Class HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE>

java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE>

public final class HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE> extends Object
  • Method Details

    • setCapturedRequestHeaders

      @CanIgnoreReturnValue public HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE> setCapturedRequestHeaders(List<String> requestHeaders)
      Configures the HTTP request headers that will be captured as span attributes as described in HTTP semantic conventions.

      The HTTP request header values will be captured under the http.request.header.<name> attribute key. The <name> part in the attribute key is the normalized header name: lowercase, with dashes replaced by underscores.

      Parameters:
      requestHeaders - A list of HTTP header names.
    • setCapturedResponseHeaders

      @CanIgnoreReturnValue public HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE> setCapturedResponseHeaders(List<String> responseHeaders)
      Configures the HTTP response headers that will be captured as span attributes as described in HTTP semantic conventions.

      The HTTP response header values will be captured under the http.response.header.<name> attribute key. The <name> part in the attribute key is the normalized header name: lowercase, with dashes replaced by underscores.

      Parameters:
      responseHeaders - A list of HTTP header names.
    • build

      public io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> build()