-
Notifications
You must be signed in to change notification settings - Fork 967
Implementation for the latest Messaging Semantic conventions. #13192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a086a82
138cce0
3ecd05d
f9d51fa
79c0d1e
d1594a1
118bf1b
1cf86e5
bacd3d3
91ae29b
aa83bad
fcfd92b
4a3ac25
b2dd7c5
eab1903
18f46bc
7d26666
f18f981
802882a
27d3a14
fcaa3ca
1259752
c3d09aa
44f55f2
b1edd96
851d668
eca37c7
067e7a3
63bc58b
b7a4cb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,20 +9,37 @@ | |
|
||
/** | ||
* Represents type of <a | ||
* href="https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#operation-names">operations</a> | ||
* href="https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#operation-types">operations</a> | ||
* that may be used in a messaging system. | ||
*/ | ||
public enum MessageOperation { | ||
@Deprecated | ||
PUBLISH, | ||
|
||
RECEIVE, | ||
PROCESS; | ||
PROCESS, | ||
CREATE, | ||
SEND, | ||
SETTLE; | ||
|
||
/** | ||
* Returns the operation name as defined in <a | ||
* href="https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#operation-names">the | ||
* specification</a>. | ||
* | ||
* @deprecated Use {@link #operationType} instead. | ||
*/ | ||
@Deprecated | ||
String operationName() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this is a package private method it is not part of the public api and can be renamed without preserving the original method. If you wish to keep the original method then it would be better to make the old method class the new one. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I marked it as deprecated as it still actively used to support the old naming convention, but should not be used for the new naming convention. To make sure that it is not used or the usage is not increased I marked it as deprecated. |
||
return name().toLowerCase(Locale.ROOT); | ||
} | ||
|
||
/** | ||
* Returns the operation type as defined in <a | ||
* href="https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#operation-types">the | ||
* specification</a>. | ||
*/ | ||
String operationType() { | ||
return name().toLowerCase(Locale.ROOT); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,51 +19,71 @@ | |
*/ | ||
public interface MessagingAttributesGetter<REQUEST, RESPONSE> { | ||
|
||
@Nullable | ||
String getSystem(REQUEST request); | ||
|
||
@Nullable | ||
String getDestination(REQUEST request); | ||
default Long getBatchMessageCount(REQUEST request, @Nullable RESPONSE response) { | ||
return null; | ||
} | ||
Comment on lines
-26
to
+27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Rearranging methods like that complicates the review. It is hard to tell what methods have been added and what was just moved. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I did this to have the list of methods align with the list of attributes on https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#messaging-attributes Then you can easily see if all attributes are covered. Do you want me to move the methods back? |
||
|
||
@Nullable | ||
String getDestinationTemplate(REQUEST request); | ||
|
||
boolean isTemporaryDestination(REQUEST request); | ||
default String getConsumerGroupName(REQUEST request) { | ||
return null; | ||
} | ||
|
||
boolean isAnonymousDestination(REQUEST request); | ||
|
||
@Nullable | ||
String getConversationId(REQUEST request); | ||
String getDestination(REQUEST request); | ||
|
||
@Nullable | ||
@Deprecated | ||
default Long getMessagePayloadSize(REQUEST request) { | ||
default String getDestinationSubscriptionName(REQUEST request) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
@Deprecated | ||
default Long getMessagePayloadCompressedSize(REQUEST request) { | ||
default String getDestinationTemplate(REQUEST request) { | ||
return null; | ||
} | ||
|
||
boolean isTemporaryDestination(REQUEST request); | ||
|
||
@Nullable | ||
Long getMessageBodySize(REQUEST request); | ||
default String getOperationName(REQUEST request, MessageOperation operation) { | ||
return operation.operationType(); | ||
} | ||
|
||
@Nullable | ||
Long getMessageEnvelopeSize(REQUEST request); | ||
String getClientId(REQUEST request); | ||
|
||
@Nullable | ||
default String getDestinationPartitionId(REQUEST request) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
default String getConversationId(REQUEST request) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
String getMessageId(REQUEST request, @Nullable RESPONSE response); | ||
|
||
@Nullable | ||
String getClientId(REQUEST request); | ||
Long getMessageBodySize(REQUEST request); | ||
|
||
@Nullable | ||
Long getBatchMessageCount(REQUEST request, @Nullable RESPONSE response); | ||
Long getMessageEnvelopeSize(REQUEST request); | ||
|
||
@Nullable | ||
default String getDestinationPartitionId(REQUEST request) { | ||
@Deprecated | ||
default Long getMessagePayloadSize(REQUEST request) { | ||
return null; | ||
} | ||
|
||
@Nullable | ||
@Deprecated | ||
default Long getMessagePayloadCompressedSize(REQUEST request) { | ||
return null; | ||
} | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.