Class HttpSpanStatusExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST,RESPONSE>
public final class HttpSpanStatusExtractor<REQUEST,RESPONSE>
extends Object
implements io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST,RESPONSE>
Extractor of the HTTP
span status. Instrumentation of HTTP server or client frameworks should use this class to
comply with OpenTelemetry HTTP semantic conventions.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST,RESPONSE> create(HttpClientAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns theSpanStatusExtractorfor HTTP requests, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.static <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST,RESPONSE> create(HttpServerAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns theSpanStatusExtractorfor HTTP requests, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.voidextract(io.opentelemetry.instrumentation.api.instrumenter.SpanStatusBuilder spanStatusBuilder, REQUEST request, RESPONSE response, Throwable error)
-
Method Details
-
create
public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST,RESPONSE> create(HttpClientAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns theSpanStatusExtractorfor HTTP requests, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise. -
create
public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.SpanStatusExtractor<REQUEST,RESPONSE> create(HttpServerAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns theSpanStatusExtractorfor HTTP requests, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise. -
extract
-