Class PeerServiceAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
-
- io.opentelemetry.javaagent.instrumentation.api.instrumenter.PeerServiceAttributesExtractor<REQUEST,RESPONSE>
-
public final class PeerServiceAttributesExtractor<REQUEST,RESPONSE> extends io.opentelemetry.instrumentation.api.instrumenter.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(io.opentelemetry.instrumentation.api.instrumenter.net.NetAttributesExtractor<REQUEST,RESPONSE> netAttributesExtractor)Returns a newPeerServiceAttributesExtractorthat will use the passednetAttributesExtractorinstance to determine the value of thepeer.serviceattribute.static <REQUEST,RESPONSE>
@Nullable PeerServiceAttributesExtractor<REQUEST,RESPONSE>createUsingReflection(String netAttributesExtractorImplClassName)Returns a newPeerServiceAttributesExtractorthat will create a new instance of typenetAttributesExtractorImplClassName(which must extendNetAttributesExtractor) and use it to determine the value of thepeer.serviceattribute.protected voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, RESPONSE response)protected voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)
-
-
-
Method Detail
-
create
public static <REQUEST,RESPONSE> PeerServiceAttributesExtractor<REQUEST,RESPONSE> create(io.opentelemetry.instrumentation.api.instrumenter.net.NetAttributesExtractor<REQUEST,RESPONSE> netAttributesExtractor)
Returns a newPeerServiceAttributesExtractorthat will use the passednetAttributesExtractorinstance to determine the value of thepeer.serviceattribute.
-
createUsingReflection
public static <REQUEST,RESPONSE> @Nullable PeerServiceAttributesExtractor<REQUEST,RESPONSE> createUsingReflection(String netAttributesExtractorImplClassName)
Returns a newPeerServiceAttributesExtractorthat will create a new instance of typenetAttributesExtractorImplClassName(which must extendNetAttributesExtractor) and use it to determine the value of thepeer.serviceattribute.
-
onStart
protected void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)
-
-