Interface MessagingAttributesGetter<REQUEST,RESPONSE>
Instrumentation authors will create implementations of this interface for their specific
library/framework. It will be used by the MessagingAttributesExtractor to obtain the
various messaging attributes in a type-generic way.
-
Method Summary
Modifier and TypeMethodDescriptiongetBatchMessageCount(REQUEST request, RESPONSE response) getClientId(REQUEST request) getConversationId(REQUEST request) getDestination(REQUEST request) default StringgetDestinationPartitionId(REQUEST request) default StringgetDestinationSubscriptionName(REQUEST request) Returns the name of the destination subscription from which a message is consumed, ornullif there is none.getDestinationTemplate(REQUEST request) default StringgetErrorType(REQUEST request, RESPONSE response, Throwable error) Returns a description of a class of error the operation ended with.getMessageBodySize(REQUEST request) getMessageEnvelopeSize(REQUEST request) getMessageHeader(REQUEST request, String name) Extracts all values of header namednamefrom the request, or an empty list if there were none.getMessageHeaderNames(REQUEST request) Extracts the names of all headers present on the request, or an empty iterable if there were none.getMessageId(REQUEST request, RESPONSE response) booleanisAnonymousDestination(REQUEST request) booleanisTemporaryDestination(REQUEST request)
-
Method Details
-
getSystem
-
getDestination
-
getDestinationTemplate
-
isTemporaryDestination
-
isAnonymousDestination
-
getConversationId
-
getMessageBodySize
-
getMessageEnvelopeSize
-
getMessageId
-
getClientId
-
getBatchMessageCount
-
getDestinationPartitionId
-
getDestinationSubscriptionName
Returns the name of the destination subscription from which a message is consumed, ornullif there is none.This attribute only exists in the v1.43 messaging semantic conventions.
-
getErrorType
@Nullable default String getErrorType(REQUEST request, @Nullable RESPONSE response, @Nullable Throwable error) Returns a description of a class of error the operation ended with.If this method returns
null, the exception class name (if any) will be used as error type.The cardinality of the error type should be low. The instrumentations implementing this method are recommended to document the custom values they support.
-
getMessageHeader
Extracts all values of header namednamefrom the request, or an empty list if there were none.Implementations of this method must not return a null value; an empty list should be returned instead.
-
getMessageHeaderNames
Extracts the names of all headers present on the request, or an empty iterable if there were none.This is used to resolve header selectors that cannot be turned into a list of exact header names, such as selectors containing wildcard patterns or selectors that only exclude headers. Selectors that only list exact header names are resolved with
getMessageHeader(Object, String)alone. To preserve compatibility with existing implementations, overriding this method is optional until 3.0.Implementations of this method must not return a null value; an empty iterable should be returned instead. The returned iterable is only read, so implementations may return a view over the underlying header names as long as that view cannot change while the returned iterable is being read.
-