Class PeerServiceAttributesExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.instrumenter.PeerServiceAttributesExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
public final class PeerServiceAttributesExtractor<REQUEST,RESPONSE>
extends Object
implements io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
Extractor of the
peer.service span attribute, described in the
specification.
Peer service name mappings can be configured using the
otel.instrumentation.common.peer-service-mapping configuration property. The format used is a
comma-separated list of host=name pairs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
PeerServiceAttributesExtractor<REQUEST,RESPONSE> create(NetClientAttributesGetter<REQUEST, RESPONSE> attributesGetter) Returns a newPeerServiceAttributesExtractorthat will use the passednetAttributesExtractorinstance to determine the value of thepeer.serviceattribute.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> PeerServiceAttributesExtractor<REQUEST,RESPONSE> create(NetClientAttributesGetter<REQUEST, RESPONSE> attributesGetter) Returns a newPeerServiceAttributesExtractorthat will use the passednetAttributesExtractorinstance to determine the value of thepeer.serviceattribute. -
onStart
public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request) -
onEnd
-