Class MessagingAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>
-
- io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesExtractor<REQUEST,RESPONSE>
-
public abstract class MessagingAttributesExtractor<REQUEST,RESPONSE> extends AttributesExtractor<REQUEST,RESPONSE>
Extractor of messaging attributes. Instrumentation of messaging frameworks/libraries should extend this class, definingMessagingAttributesExtractorandMessagingAttributesExtractorwith the actual request / response types 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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringTEMP_DESTINATION_NAME
-
Constructor Summary
Constructors Constructor Description MessagingAttributesExtractor()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract @Nullable StringconversationId(REQUEST request)protected abstract @Nullable Stringdestination(REQUEST request)protected abstract @Nullable StringdestinationKind(REQUEST request)protected abstract @Nullable StringmessageId(REQUEST request, @Nullable RESPONSE response)protected abstract @Nullable LongmessagePayloadCompressedSize(REQUEST request)protected abstract @Nullable LongmessagePayloadSize(REQUEST request)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.protected abstract @Nullable MessageOperationoperation(REQUEST request)protected abstract @Nullable Stringprotocol(REQUEST request)protected abstract @Nullable StringprotocolVersion(REQUEST request)protected abstract @Nullable Stringsystem(REQUEST request)protected abstract booleantemporaryDestination(REQUEST request)protected abstract @Nullable Stringurl(REQUEST request)-
Methods inherited from class io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor
set
-
-
-
-
Field Detail
-
TEMP_DESTINATION_NAME
public static final String TEMP_DESTINATION_NAME
- See Also:
- Constant Field Values
-
-
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>
-
temporaryDestination
protected abstract boolean temporaryDestination(REQUEST request)
-
messagePayloadCompressedSize
protected abstract @Nullable Long messagePayloadCompressedSize(REQUEST request)
-
operation
protected abstract @Nullable MessageOperation operation(REQUEST request)
-
-