Class NettyClientTelemetryBuilder
java.lang.Object
io.opentelemetry.instrumentation.netty.v4_1.NettyClientTelemetryBuilder
A builder of
NettyClientTelemetry.-
Method Summary
Modifier and TypeMethodDescriptionaddAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel, io.netty.handler.codec.http.HttpResponse> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items.build()Returns a newNettyClientTelemetrywith the given configuration.setCapturedRequestHeaders(List<String> capturedRequestHeaders) Configures the HTTP request headers that will be captured as span attributes.setCapturedResponseHeaders(List<String> capturedResponseHeaders) Configures the HTTP response headers that will be captured as span attributes.setEmitExperimentalHttpClientMetrics(boolean emitExperimentalHttpClientMetrics) Configures the instrumentation to emit experimental HTTP client metrics.setKnownMethods(Set<String> knownMethods) Configures the instrumentation to recognize an alternative set of HTTP request methods.
-
Method Details
-
setCapturedRequestHeaders
@CanIgnoreReturnValue public NettyClientTelemetryBuilder setCapturedRequestHeaders(List<String> capturedRequestHeaders) Configures the HTTP request headers that will be captured as span attributes.- Parameters:
capturedRequestHeaders- A list of HTTP header names.
-
setCapturedResponseHeaders
@CanIgnoreReturnValue public NettyClientTelemetryBuilder setCapturedResponseHeaders(List<String> capturedResponseHeaders) Configures the HTTP response headers that will be captured as span attributes.- Parameters:
capturedResponseHeaders- A list of HTTP header names.
-
addAttributesExtractor
@CanIgnoreReturnValue public NettyClientTelemetryBuilder addAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<io.opentelemetry.instrumentation.netty.v4.common.HttpRequestAndChannel, io.netty.handler.codec.http.HttpResponse> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items. -
setKnownMethods
Configures the instrumentation to recognize an alternative set of HTTP request methods.By default, this instrumentation defines "known" methods as the ones listed in RFC9110 and the PATCH method defined in RFC5789.
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.- See Also:
-
HttpClientAttributesExtractorBuilder.setKnownMethods(Set)
-
setEmitExperimentalHttpClientMetrics
@CanIgnoreReturnValue public NettyClientTelemetryBuilder setEmitExperimentalHttpClientMetrics(boolean emitExperimentalHttpClientMetrics) Configures the instrumentation to emit experimental HTTP client metrics.- Parameters:
emitExperimentalHttpClientMetrics-trueif the experimental HTTP client metrics are to be emitted.
-
build
Returns a newNettyClientTelemetrywith the given configuration.
-