Class RpcAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
-
- io.opentelemetry.instrumentation.api.instrumenter.rpc.RpcAttributesExtractor<REQUEST,RESPONSE>
-
public abstract class RpcAttributesExtractor<REQUEST,RESPONSE> extends AttributesExtractor<REQUEST,RESPONSE>
Extractor of RPC attributes. Instrumentations of RPC libraries should extend this class, definingRpcAttributesExtractorwith the actual request type of the instrumented library. If an attribute is not available in this library, it is appropriate to returnnullfrom the protected attribute methods, but implement as many as possible for best compliance with the OpenTelemetry specification.
-
-
Constructor Summary
Constructors Constructor Description RpcAttributesExtractor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract @Nullable Stringmethod(REQUEST request)protected voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, REQUEST request, 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.protected abstract @Nullable Stringservice(REQUEST request)protected abstract @Nullable Stringsystem(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, RESPONSE response)Description copied from class:AttributesExtractorExtracts attributes from theAttributesExtractorandAttributesExtractorinto theAttributesBuilderat the end of a request.- Specified by:
onEndin classAttributesExtractor<REQUEST,RESPONSE>
-
-