Class NetAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
-
- io.opentelemetry.instrumentation.api.instrumenter.net.NetAttributesExtractor<REQUEST,RESPONSE>
-
- Direct Known Subclasses:
InetSocketAddressNetAttributesExtractor
public abstract class NetAttributesExtractor<REQUEST,RESPONSE> extends AttributesExtractor<REQUEST,RESPONSE>
Extractor of Network attributes. It is common to have access toInetSocketAddress, in which case it is more convenient to useInetSocketAddressNetAttributesExtractor.
-
-
Constructor Summary
Constructors Constructor Description NetAttributesExtractor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response)Extracts attributes from theAttributesExtractorandAttributesExtractorinto theAttributesBuilderat the end of a request.protected voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)Extracts attributes from theAttributesExtractorinto theAttributesBuilderat the beginning of a request.abstract @Nullable StringpeerIp(REQUEST request, @Nullable RESPONSE response)This method will be called twice: both when the request starts (responseis always null then) and when the response ends.abstract @Nullable StringpeerName(REQUEST request, @Nullable RESPONSE response)This method will be called twice: both when the request starts (responseis always null then) and when the response ends.abstract @Nullable IntegerpeerPort(REQUEST request, @Nullable RESPONSE response)This method will be called twice: both when the request starts (responseis always null then) and when the response ends.abstract @Nullable Stringtransport(REQUEST request)-
Methods inherited from class io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor
set
-
-
-
-
Method Detail
-
onStart
protected final void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request)Description copied from class:AttributesExtractorExtracts attributes from theAttributesExtractorinto theAttributesBuilderat the beginning of a request.- Specified by:
onStartin classAttributesExtractor<REQUEST,RESPONSE>
-
onEnd
protected final void onEnd(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, @Nullable RESPONSE response)Description copied from class:AttributesExtractorExtracts attributes from theAttributesExtractorandAttributesExtractorinto theAttributesBuilderat the end of a request.- Specified by:
onEndin classAttributesExtractor<REQUEST,RESPONSE>
-
peerName
public abstract @Nullable String peerName(REQUEST request, @Nullable RESPONSE response)
This method will be called twice: both when the request starts (responseis always null then) and when the response ends. This way it is possible to capture net attributes in both phases of processing.
-
peerPort
public abstract @Nullable Integer peerPort(REQUEST request, @Nullable RESPONSE response)
This method will be called twice: both when the request starts (responseis always null then) and when the response ends. This way it is possible to capture net attributes in both phases of processing.
-
-