Class HttpServerAttributesExtractorBuilder<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.http.HttpServerAttributesExtractorBuilder<REQUEST,RESPONSE>
A builder of
HttpServerAttributesExtractor.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newHttpServerAttributesExtractorwith the settings of thisHttpServerAttributesExtractorBuilder.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 HttpServerAttributesExtractorBuilder<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 HttpServerAttributesExtractorBuilder<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 newHttpServerAttributesExtractorwith the settings of thisHttpServerAttributesExtractorBuilder.
-