Class MessageTypeSpanAttributesProvider
java.lang.Object
org.axonframework.messaging.tracing.attributes.MessageTypeSpanAttributesProvider
- All Implemented Interfaces:
SpanAttributesProvider
public final class MessageTypeSpanAttributesProvider
extends Object
implements SpanAttributesProvider
Adds the message's
type (its qualified name plus version) to the
span. By default the attribute key is DEFAULT_ATTRIBUTE_KEY (axoniq.message.type); a different key
can be supplied through the constructor.- Since:
- 4.6.0
- Author:
- Mateusz Nowak, Mitchell Herrijgers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault attribute key under which the message type is recorded. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a provider recording the message type under the defaultDEFAULT_ATTRIBUTE_KEYkey.MessageTypeSpanAttributesProvider(String attributeKey) Creates a provider recording the message type under the givenattributeKey. -
Method Summary
Modifier and TypeMethodDescriptionprovideForMessage(Message message, @Nullable ProcessingContext context) Provides the attributes this provider contributes for the givenmessageand optionalcontext.
-
Field Details
-
DEFAULT_ATTRIBUTE_KEY
Default attribute key under which the message type is recorded.- See Also:
-
-
Constructor Details
-
MessageTypeSpanAttributesProvider
public MessageTypeSpanAttributesProvider()Creates a provider recording the message type under the defaultDEFAULT_ATTRIBUTE_KEYkey. -
MessageTypeSpanAttributesProvider
Creates a provider recording the message type under the givenattributeKey.- Parameters:
attributeKey- the span attribute key to record the message type under
-
-
Method Details
-
provideForMessage
Description copied from interface:SpanAttributesProviderProvides the attributes this provider contributes for the givenmessageand optionalcontext.- Specified by:
provideForMessagein interfaceSpanAttributesProvider- Parameters:
message- the message the span is created forcontext- the active processing context, ornullwhen none is available- Returns:
- the attributes to add to the span; an empty map when this provider contributes nothing
-