Class NettyServerTelemetryBuilder
java.lang.Object
io.opentelemetry.instrumentation.netty.v4_1.NettyServerTelemetryBuilder
A builder of
NettyServerTelemetry.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns a newNettyServerTelemetrywith 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.setEmitExperimentalHttpServerMetrics(boolean emitExperimentalHttpServerMetrics) Configures the instrumentation to emit experimental HTTP server metrics.setKnownMethods(Set<String> knownMethods) Configures the instrumentation to recognize an alternative set of HTTP request methods.
-
Method Details
-
setCapturedRequestHeaders
@CanIgnoreReturnValue public NettyServerTelemetryBuilder 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 NettyServerTelemetryBuilder setCapturedResponseHeaders(List<String> capturedResponseHeaders) Configures the HTTP response headers that will be captured as span attributes.- Parameters:
capturedResponseHeaders- A list of HTTP header names.
-
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:
-
HttpServerAttributesExtractorBuilder.setKnownMethods(Set)
-
setEmitExperimentalHttpServerMetrics
@CanIgnoreReturnValue public NettyServerTelemetryBuilder setEmitExperimentalHttpServerMetrics(boolean emitExperimentalHttpServerMetrics) Configures the instrumentation to emit experimental HTTP server metrics.- Parameters:
emitExperimentalHttpServerMetrics-trueif the experimental HTTP server metrics are to be emitted.
-
build
Returns a newNettyServerTelemetrywith the given configuration.
-