Class HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.http.HttpClientAttributesExtractorBuilder<REQUEST,RESPONSE>
A builder of
HttpClientAttributesExtractor.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newHttpClientAttributesExtractorwith the settings of thisHttpClientAttributesExtractorBuilder.setCapturedRequestHeaders(List<String> requestHeaders) Configures the HTTP request headers that will be captured as span attributes as described in HTTP semantic conventions.setCapturedResponseHeaders(List<String> responseHeaders) Configures the HTTP response headers that will be captured as span attributes as described in HTTP semantic conventions.
-
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
Returns a newHttpClientAttributesExtractorwith the settings of thisHttpClientAttributesExtractorBuilder.
-