Class MessagingAttributesExtractor<REQUEST,RESPONSE>
java.lang.Object
io.opentelemetry.instrumentation.api.incubator.semconv.messaging.MessagingAttributesExtractor<REQUEST,RESPONSE>
- All Implemented Interfaces:
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,,RESPONSE> io.opentelemetry.instrumentation.api.internal.SpanKeyProvider
public final class MessagingAttributesExtractor<REQUEST,RESPONSE>
extends Object
implements io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE>, io.opentelemetry.instrumentation.api.internal.SpanKeyProvider
Extractor of messaging
attributes.
This class delegates to a type-specific MessagingAttributesGetter for individual
attribute extraction from request/response objects.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <REQUEST,RESPONSE>
MessagingAttributesExtractorBuilder<REQUEST, RESPONSE> builder(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessageOperation operation) Deprecated.static <REQUEST,RESPONSE>
MessagingAttributesExtractorBuilder<REQUEST, RESPONSE> builder(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessagingOperationType operationType, String operationName) Returns a newMessagingAttributesExtractorBuilderconfigured for the given operation type.static <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST, RESPONSE> create(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessageOperation operation) Deprecated.static <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST, RESPONSE> create(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessagingOperationType operationType, String operationName) Creates the messaging attributes extractor for the given operation type.io.opentelemetry.instrumentation.api.internal.SpanKeyThis method is internal and is hence not for public use.voidonEnd(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context context, REQUEST request, RESPONSE response, Throwable error) voidonStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request)
-
Method Details
-
create
public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessagingOperationType operationType, String operationName) Creates the messaging attributes extractor for the given operation type.- Parameters:
operationName- the system-specific name of the operation, emitted asmessaging.operation.name, e.g.send,pollorack.
-
create
@Deprecated public static <REQUEST,RESPONSE> io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(MessagingAttributesGetter<REQUEST, RESPONSE> getter, @Nullable MessageOperation operation) Deprecated.Usecreate(MessagingAttributesGetter, MessagingOperationType, String). May be removed in the next minor release. -
builder
public static <REQUEST,RESPONSE> MessagingAttributesExtractorBuilder<REQUEST,RESPONSE> builder(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessagingOperationType operationType, String operationName) Returns a newMessagingAttributesExtractorBuilderconfigured for the given operation type.- Parameters:
operationName- the system-specific name of the operation, emitted asmessaging.operation.name, e.g.send,pollorack.
-
builder
@Deprecated public static <REQUEST,RESPONSE> MessagingAttributesExtractorBuilder<REQUEST,RESPONSE> builder(MessagingAttributesGetter<REQUEST, RESPONSE> getter, @Nullable MessageOperation operation) Deprecated.Usebuilder(MessagingAttributesGetter, MessagingOperationType, String). May be removed in the next minor release. -
onStart
public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request) -
onEnd
-
internalGetSpanKey
This method is internal and is hence not for public use. Its API is unstable and can change at any time.- Specified by:
internalGetSpanKeyin interfaceio.opentelemetry.instrumentation.api.internal.SpanKeyProvider
-
builder(MessagingAttributesGetter, MessagingOperationType, String).