Class HttpClientServicePeerAttributesExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.http.HttpClientServicePeerAttributesExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
public final class HttpClientServicePeerAttributesExtractor<REQUEST,RESPONSE>
extends Object
implements io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
Extractor of the
service.peer.name span attribute, described in the
specification.-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST, RESPONSE> create(io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter<REQUEST, RESPONSE> attributesGetter, io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newHttpClientServicePeerAttributesExtractorthat will use the passedattributesGetterto extract server address and port (with fallback to the HTTP Host header).voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, RESPONSE response, Throwable error) voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)
-
Method Details
-
create
public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(io.opentelemetry.instrumentation.api.semconv.http.HttpClientAttributesGetter<REQUEST, RESPONSE> attributesGetter, io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newHttpClientServicePeerAttributesExtractorthat will use the passedattributesGetterto extract server address and port (with fallback to the HTTP Host header).- Parameters:
attributesGetter- the getter to extract HTTP client attributes from the requestopenTelemetry- the OpenTelemetry instance to read service peer mapping configuration from
-
onStart
public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request) -
onEnd
-