Class DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE>
-
Method Summary
Modifier and TypeMethodDescriptionaddAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super REQUEST, ? super RESPONSE> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items.build()configure(CommonConfig config) static <REQUEST,RESPONSE>
DefaultHttpServerInstrumenterBuilder<REQUEST, RESPONSE> create(String instrumentationName, io.opentelemetry.api.OpenTelemetry openTelemetry, io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesGetter<REQUEST, RESPONSE> attributesGetter) static <REQUEST,RESPONSE>
DefaultHttpServerInstrumenterBuilder<REQUEST, RESPONSE> create(String instrumentationName, io.opentelemetry.api.OpenTelemetry openTelemetry, io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesGetter<REQUEST, RESPONSE> attributesGetter, io.opentelemetry.context.propagation.TextMapGetter<REQUEST> headerGetter) setBuilderCustomizer(Consumer<io.opentelemetry.instrumentation.api.instrumenter.InstrumenterBuilder<REQUEST, RESPONSE>> builderCustomizer) setCapturedRequestHeaders(Collection<String> requestHeaders) Configures the HTTP request headers that will be captured as span attributes.setCapturedResponseHeaders(Collection<String> responseHeaders) Configures the HTTP response headers that will be captured as span attributes.setEmitExperimentalHttpServerTelemetry(boolean emitExperimentalHttpServerTelemetry) Configures the instrumentation to emit experimental HTTP server telemetry.setKnownMethods(Collection<String> knownMethods) Configures the instrumentation to recognize an alternative set of HTTP request methods.setRequestHeaders(io.opentelemetry.instrumentation.api.config.IncludeExclude requestHeaders) Configures which HTTP request headers are captured as span attributes.setResponseHeaders(io.opentelemetry.instrumentation.api.config.IncludeExclude responseHeaders) Configures which HTTP response headers are captured as span attributes.setSensitiveQueryParameters(Set<String> sensitiveQueryParameters) Configures the instrumentation to redact specific URL query parameters.setSpanNameExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>> spanNameExtractorCustomizer) Sets a customizer that receives the defaultSpanNameExtractorand returns a customized one.setSpanStatusExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST, RESPONSE>> spanStatusExtractorCustomizer)
-
Method Details
-
create
public static <REQUEST,RESPONSE> DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> create(String instrumentationName, io.opentelemetry.api.OpenTelemetry openTelemetry, io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesGetter<REQUEST, RESPONSE> attributesGetter) -
create
public static <REQUEST,RESPONSE> DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> create(String instrumentationName, io.opentelemetry.api.OpenTelemetry openTelemetry, io.opentelemetry.instrumentation.api.semconv.http.HttpServerAttributesGetter<REQUEST, RESPONSE> attributesGetter, io.opentelemetry.context.propagation.TextMapGetter<REQUEST> headerGetter) -
addAttributesExtractor
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> addAttributesExtractor(io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<? super REQUEST, ? super RESPONSE> attributesExtractor) Adds an additionalAttributesExtractorto invoke to set attributes to instrumented items. -
setSpanStatusExtractorCustomizer
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setSpanStatusExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST, RESPONSE>> spanStatusExtractorCustomizer) -
setRequestHeaders
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setRequestHeaders(io.opentelemetry.instrumentation.api.config.IncludeExclude requestHeaders) Configures which HTTP request headers are captured as span attributes.Selector patterns are matched case-insensitively, since HTTP header names are case-insensitive.
?matches one character and*matches any number of characters, including none. Excluded patterns take precedence over included patterns. A selector with no included patterns captures every header that is not excluded, and an empty selector captures no headers. -
setCapturedRequestHeaders
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setCapturedRequestHeaders(Collection<String> requestHeaders) Configures the HTTP request headers that will be captured as span attributes.The header names are matched literally, so
*and?are not treated as glob patterns.- Parameters:
requestHeaders- A list of HTTP header names.
-
setResponseHeaders
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setResponseHeaders(io.opentelemetry.instrumentation.api.config.IncludeExclude responseHeaders) Configures which HTTP response headers are captured as span attributes.Selector patterns are matched case-insensitively, since HTTP header names are case-insensitive.
?matches one character and*matches any number of characters, including none. Excluded patterns take precedence over included patterns. A selector with no included patterns captures every header that is not excluded, and an empty selector captures no headers. -
setCapturedResponseHeaders
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setCapturedResponseHeaders(Collection<String> responseHeaders) Configures the HTTP response headers that will be captured as span attributes.The header names are matched literally, so
*and?are not treated as glob patterns.- Parameters:
responseHeaders- A list of HTTP header names.
-
setKnownMethods
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setKnownMethods(Collection<String> knownMethods) 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:
-
setEmitExperimentalHttpServerTelemetry
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setEmitExperimentalHttpServerTelemetry(boolean emitExperimentalHttpServerTelemetry) Configures the instrumentation to emit experimental HTTP server telemetry.- Parameters:
emitExperimentalHttpServerTelemetry-trueif the experimental HTTP server telemetry is to be emitted.
-
setSensitiveQueryParameters
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setSensitiveQueryParameters(Set<String> sensitiveQueryParameters) Configures the instrumentation to redact specific URL query parameters.- Parameters:
sensitiveQueryParameters- the set of query parameter names whose values should be redacted.
-
setSpanNameExtractorCustomizer
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> setSpanNameExtractorCustomizer(UnaryOperator<io.opentelemetry.instrumentation.api.instrumenter.SpanNameExtractor<REQUEST>> spanNameExtractorCustomizer) Sets a customizer that receives the defaultSpanNameExtractorand returns a customized one. -
setBuilderCustomizer
-
build
-
instrumenterBuilder
-
configure
@CanIgnoreReturnValue public DefaultHttpServerInstrumenterBuilder<REQUEST,RESPONSE> configure(CommonConfig config)
-