Interface SpanAttributesProvider
- All Known Implementing Classes:
AggregateIdentifierSpanAttributesProvider,EventTagsSpanAttributesProvider,MessageIdSpanAttributesProvider,MessageTypeSpanAttributesProvider,MetadataSpanAttributesProvider
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Contributes attributes to a
Span based on the Message the span is created for. Multiple providers
compose; the order in which they are invoked is unspecified.
The context parameter is Nullable because some span-creation points have no
ProcessingContext available. Providers that do not need the context ignore it; providers that do need it
(for example AggregateIdentifierSpanAttributesProvider,
which reads from LegacyResources.AGGREGATE_IDENTIFIER_KEY) MUST handle
null gracefully.
Implementations MUST NOT depend on message types that have been removed from the framework.
- Since:
- 4.6.0
- Author:
- Mateusz Nowak, Mitchell Herrijgers
-
Method Summary
Modifier and TypeMethodDescriptionprovideForMessage(Message message, @Nullable ProcessingContext context) Provides the attributes this provider contributes for the givenmessageand optionalcontext.
-
Method Details
-
provideForMessage
Provides the attributes this provider contributes for the givenmessageand optionalcontext.- 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
-