Class ServicePeerAttributesExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.service.peer.ServicePeerAttributesExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
public final class ServicePeerAttributesExtractor<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.network.ServerAttributesGetter<REQUEST> attributesGetter, io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newServicePeerAttributesExtractorthat will use the passedattributesGetterinstance to determine the value of theservice.peer.nameattribute.static <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST, RESPONSE> create(io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesGetter<REQUEST> attributesGetter, ServicePeerResolver servicePeerResolver) Deprecated.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.network.ServerAttributesGetter<REQUEST> attributesGetter, io.opentelemetry.api.OpenTelemetry openTelemetry) Returns a newServicePeerAttributesExtractorthat will use the passedattributesGetterinstance to determine the value of theservice.peer.nameattribute.- Parameters:
attributesGetter- the getter to extract server address and port from the requestopenTelemetry- the OpenTelemetry instance to read service peer mapping configuration from
-
create
@Deprecated public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(io.opentelemetry.instrumentation.api.semconv.network.ServerAttributesGetter<REQUEST> attributesGetter, ServicePeerResolver servicePeerResolver) Deprecated.Usecreate(ServerAttributesGetter, OpenTelemetry)instead.This method is internal and is hence not for public use. Its APIs are unstable and can change at any time.This method only exists to bridge the deprecated
PeerServiceAttributesExtractor. -
onStart
public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request) -
onEnd
-
create(ServerAttributesGetter, OpenTelemetry)instead.