Class HttpSpanStatusExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.http.HttpSpanStatusExtractor<REQUEST,RESPONSE>
-
- All Implemented Interfaces:
SpanStatusExtractor<REQUEST,RESPONSE>
public final class HttpSpanStatusExtractor<REQUEST,RESPONSE> extends Object implements 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
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <REQUEST,RESPONSE>
SpanStatusExtractor<REQUEST,RESPONSE>create(HttpCommonAttributesExtractor<? super REQUEST,? super RESPONSE> attributesExtractor)Returns theSpanStatusExtractorfor HTTP requests, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.io.opentelemetry.api.trace.StatusCodeextract(REQUEST request, RESPONSE response, Throwable error)Returns theStatusCode.
-
-
-
Method Detail
-
create
public static <REQUEST,RESPONSE> SpanStatusExtractor<REQUEST,RESPONSE> create(HttpCommonAttributesExtractor<? super REQUEST,? super RESPONSE> attributesExtractor)
Returns theSpanStatusExtractorfor HTTP requests, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.
-
extract
public io.opentelemetry.api.trace.StatusCode extract(REQUEST request, @Nullable RESPONSE response, Throwable error)
Description copied from interface:SpanStatusExtractorReturns theStatusCode.- Specified by:
extractin interfaceSpanStatusExtractor<REQUEST,RESPONSE>
-
-