Class PeerServiceAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.PeerServiceAttributesExtractor<REQUEST,RESPONSE>
-
- All Implemented Interfaces:
AttributesExtractor<REQUEST,RESPONSE>
public final class PeerServiceAttributesExtractor<REQUEST,RESPONSE> extends Object implements AttributesExtractor<REQUEST,RESPONSE>
Extractor of thepeer.servicespan attribute, described in the specification.Peer service name mappings can be configured using the
otel.instrumentation.common.peer-service-mappingconfiguration property. The format used is a comma-separated list ofhost=namepairs.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, RESPONSE response, Throwable error)Extracts attributes from theContext, theAttributesExtractorand eitherAttributesExtractororerrorinto theAttributesBuilderat the end of a request.voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)Extracts attributes from theContextand theAttributesExtractorinto theAttributesBuilderat the beginning of a request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor
onEnd, onStart, set
-
-
-
-
Method Detail
-
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)Description copied from interface:AttributesExtractorExtracts attributes from theContextand theAttributesExtractorinto theAttributesBuilderat the beginning of a request.- Specified by:
onStartin interfaceAttributesExtractor<REQUEST,RESPONSE>
-
onEnd
public void onEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error)Description copied from interface:AttributesExtractorExtracts attributes from theContext, theAttributesExtractorand eitherAttributesExtractororerrorinto theAttributesBuilderat the end of a request.- Specified by:
onEndin interfaceAttributesExtractor<REQUEST,RESPONSE>
-
-