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) Returns a newMessagingAttributesExtractorBuilderfor the givenoperationthat can be used to configure the messaging attributes extractor.static <REQUEST,RESPONSE>
io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor<REQUEST,RESPONSE> create(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessageOperation operation) Creates the messaging attributes extractor for the givenoperationwith default configuration.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, MessageOperation operation) Creates the messaging attributes extractor for the givenoperationwith default configuration. -
builder
public static <REQUEST,RESPONSE> MessagingAttributesExtractorBuilder<REQUEST,RESPONSE> builder(MessagingAttributesGetter<REQUEST, RESPONSE> getter, MessageOperation operation) Returns a newMessagingAttributesExtractorBuilderfor the givenoperationthat can be used to configure the messaging attributes extractor. -
onStart
public void onStart(io.opentelemetry.api.common.AttributesBuilder attributes, io.opentelemetry.context.Context parentContext, REQUEST request) -
onEnd
-
internalGetSpanKey
public io.opentelemetry.instrumentation.api.internal.SpanKey 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
-