Class HttpSpanStatusExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.semconv.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.
- Since:
- 2.0.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
SpanStatusExtractor<REQUEST, RESPONSE> create(HttpClientAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns the HTTP clientSpanStatusExtractor, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.static <REQUEST,RESPONSE>
SpanStatusExtractor<REQUEST, RESPONSE> create(HttpServerAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns the HTTP serverSpanStatusExtractor, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.voidextract(SpanStatusBuilder spanStatusBuilder, REQUEST request, RESPONSE response, Throwable error) Extracts the status from the response and sets it to thespanStatusBuilder.
-
Method Details
-
create
public static <REQUEST,RESPONSE> SpanStatusExtractor<REQUEST,RESPONSE> create(HttpClientAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns the HTTP clientSpanStatusExtractor, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.- See Also:
-
create
public static <REQUEST,RESPONSE> SpanStatusExtractor<REQUEST,RESPONSE> create(HttpServerAttributesGetter<? super REQUEST, ? super RESPONSE> getter) Returns the HTTP serverSpanStatusExtractor, which will use the HTTP status code to determine theStatusCodeif available or fallback to the default status otherwise.- See Also:
-
extract
public void extract(SpanStatusBuilder spanStatusBuilder, REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error) Description copied from interface:SpanStatusExtractorExtracts the status from the response and sets it to thespanStatusBuilder.- Specified by:
extractin interfaceSpanStatusExtractor<REQUEST,RESPONSE>
-