Class ApacheHttpClientTelemetryBuilder
java.lang.Object
io.opentelemetry.instrumentation.apachehttpclient.v4_3.ApacheHttpClientTelemetryBuilder
A builder for
ApacheHttpClientTelemetry.-
Method Summary
Modifier and TypeMethodDescriptionaddAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super ApacheHttpClientRequest, ? super org.apache.http.HttpResponse> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items.build()Returns a newApacheHttpClientTelemetryconfigured with thisApacheHttpClientTelemetryBuilder.setCapturedRequestHeaders(List<String> requestHeaders) Configures the HTTP request headers that will be captured as span attributes.setCapturedResponseHeaders(List<String> responseHeaders) Configures the HTTP response headers that will be captured as span attributes.
-
Method Details
-
addAttributeExtractor
@CanIgnoreReturnValue public ApacheHttpClientTelemetryBuilder addAttributeExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super ApacheHttpClientRequest, ? super org.apache.http.HttpResponse> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items. TheAttributesExtractorwill be executed after all default extractors. -
setCapturedRequestHeaders
@CanIgnoreReturnValue public ApacheHttpClientTelemetryBuilder setCapturedRequestHeaders(List<String> requestHeaders) Configures the HTTP request headers that will be captured as span attributes.- Parameters:
requestHeaders- A list of HTTP header names.
-
setCapturedResponseHeaders
@CanIgnoreReturnValue public ApacheHttpClientTelemetryBuilder setCapturedResponseHeaders(List<String> responseHeaders) Configures the HTTP response headers that will be captured as span attributes.- Parameters:
responseHeaders- A list of HTTP header names.
-
build
Returns a newApacheHttpClientTelemetryconfigured with thisApacheHttpClientTelemetryBuilder.
-