Class MessagingAttributesExtractor<REQUEST,RESPONSE>
- java.lang.Object
-
- io.opentelemetry.instrumentation.api.instrumenter.messaging.MessagingAttributesExtractor<REQUEST,RESPONSE>
-
- All Implemented Interfaces:
AttributesExtractor<REQUEST,RESPONSE>
public abstract class MessagingAttributesExtractor<REQUEST,RESPONSE> extends Object implements 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 StringconversationId(REQUEST request)protected abstract Stringdestination(REQUEST request)protected abstract StringdestinationKind(REQUEST request)protected abstract StringmessageId(REQUEST request, RESPONSE response)protected abstract LongmessagePayloadCompressedSize(REQUEST request)protected abstract LongmessagePayloadSize(REQUEST request)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.abstract MessageOperationoperation()protected abstract Stringprotocol(REQUEST request)protected abstract StringprotocolVersion(REQUEST request)protected abstract Stringsystem(REQUEST request)protected abstract booleantemporaryDestination(REQUEST request)protected abstract Stringurl(REQUEST 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
-
-
-
-
Field Detail
-
TEMP_DESTINATION_NAME
public static final String TEMP_DESTINATION_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
onStart
public final 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 final 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>
-
operation
public abstract MessageOperation operation()
-
temporaryDestination
protected abstract boolean temporaryDestination(REQUEST request)
-
messagePayloadCompressedSize
@Nullable protected abstract Long messagePayloadCompressedSize(REQUEST request)
-
-