-
Notifications
You must be signed in to change notification settings - Fork 590
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
Change OTel attribute messaging.operation to messaging.operation.type #1716
Change OTel attribute messaging.operation to messaging.operation.type #1716
Conversation
This is separate issue, but there were a couple problems with building this:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear/>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</packageSources>
</configuration>
|
1b334d7
to
381b29d
Compare
I don't know if the values are also up for changing here, but we're also using deprecated values:
|
(sorry for the force push, I was a little too trigger happy on the create PR button) |
@iinuwa no worries, as long as the end result of a PR looks like what you want, you can force push all you want on topic branches. |
@iinuwa please update the enum values to |
@michaelklishin Sorry, I didn't see an enum or const string for the old Did you want me to add a new set of const strings for these? Do you also want to rename |
@iinuwa I did not mean "an enum" in the C# sense but rather in an abstract sense. The accepted values of message "types" are well known. We need to switch to the recently recommended ones before 7.0 ships. I think it can be a part of this PR. |
As for renaming OpenTelemetry support was originally contributed in #1528 by @stebet, @lmolkova and others. Perhaps they would have an opinion. |
I think I was confused since the values were already updated in this PR (I think you may have reviewed before I pushed those changes). I've added the const strings too to make them more apparent. |
@iinuwa this does not update relevant tests, for example, the |
@iinuwa you must clone with submodules, or update submodules afterward. |
I am pinging these people because they all reviewed #1528 - @danielmarbach |
Source: https://github.com/npgsql/npgsql/blob/main/NuGet.config As suggested here: #1716 (comment)
1eefb59
to
ab67b7b
Compare
@iinuwa as @michaelklishin says here, please fix the test suite. Thank you for your contribution. |
Done, thank you! Sorry for the confusion; I always forget about git submodules, and it wasn't mentioned in the CONTRIBUTING.md doc. That made me able to run the tests locally. |
Feel free to modify that file in this PR to mention cloning with submodules. Thanks. |
Took a stab at updating the docs. |
94f825f
to
acb3515
Compare
Thank you for the review @danielmarbach |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -63,14 +66,14 @@ public static class RabbitMQActivitySource | |||
|
|||
Activity? activity = linkedContext == default | |||
? s_publisherSource.StartRabbitMQActivity( | |||
UseRoutingKeyAsOperationName ? $"{routingKey} publish" : "publish", | |||
UseRoutingKeyAsOperationName ? $"{routingKey} {MessagingOperationTypeSend}" : MessagingOperationTypeSend, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
span name should be {operation name} {destination}
- https://github.com/open-telemetry/semantic-conventions/blob/main/docs/messaging/messaging-spans.md#span-name.
I.e. publish
stays (as rabbit-friendly operation name), but the order has changed and should now be publish {routingKey}
Or if you want to call it basic_publish
instead of publish
or anything else (language-agnostic) - go for it - happy to update otel semconv with your preference.
@@ -85,12 +88,12 @@ public static class RabbitMQActivitySource | |||
} | |||
|
|||
Activity? activity = s_subscriberSource.StartRabbitMQActivity( | |||
UseRoutingKeyAsOperationName ? $"{queue} receive" : "receive", | |||
UseRoutingKeyAsOperationName ? $"{queue} {MessagingOperationTypeReceive}" : MessagingOperationTypeReceive, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this activity created for BasicGet
? If so, let's pick a rabbitMQ-friendly operation name for it.
See my comment on publish.
Also, the order has changed - it's now {operation_name} {destination}
ActivityKind.Producer, linkedContext); | ||
if (activity != null && activity.IsAllDataRequested) | ||
{ | ||
PopulateMessagingTags("publish", routingKey, exchange, 0, bodySize, activity); | ||
PopulateMessagingTags(MessagingOperationTypeSend, routingKey, exchange, 0, bodySize, activity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll need to set operation name too - it's required now.
ActivityKind.Consumer); | ||
if (activity != null && activity.IsAllDataRequested) | ||
{ | ||
activity | ||
.SetTag(MessagingOperation, "receive") | ||
.SetTag(MessagingOperationType, MessagingOperationTypeReceive) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.SetTag(MessagingOperationType, MessagingOperationTypeReceive) | |
.SetTag(MessagingOperationName, "something that we'll pick for `BasicGet``") |
@@ -107,11 +110,11 @@ public static class RabbitMQActivitySource | |||
|
|||
// Extract the PropagationContext of the upstream parent from the message headers. | |||
Activity? activity = s_subscriberSource.StartLinkedRabbitMQActivity( | |||
UseRoutingKeyAsOperationName ? $"{routingKey} receive" : "receive", ActivityKind.Consumer, | |||
UseRoutingKeyAsOperationName ? $"{routingKey} {MessagingOperationTypeReceive}" : MessagingOperationTypeReceive, ActivityKind.Consumer, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
@@ -128,11 +131,11 @@ public static class RabbitMQActivitySource | |||
|
|||
// Extract the PropagationContext of the upstream parent from the message headers. | |||
Activity? activity = s_subscriberSource.StartLinkedRabbitMQActivity( | |||
UseRoutingKeyAsOperationName ? $"{routingKey} deliver" : "deliver", | |||
UseRoutingKeyAsOperationName ? $"{routingKey} {MessagingOperationTypeProcess}" : MessagingOperationTypeProcess, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one is probably for consume
, so let's do consume|basic_consume|... {routing_key}
and add the operation name tag with the name we'll pick
acb3515
to
e2c246f
Compare
No, this is ready to merge. #1717 addresses the remaining changes.
|
Thank you. Let's continue in #1717. |
Proposed Changes
Update
messaging.operation
tomessaging.operation.type
to comply with OpenTelemetry Semantic Conventions for Messaging.Addresses part of #1715.
References #1528.
Types of Changes
What types of changes does your code introduce to this project?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creatingthe PR. If you're unsure about any of them, don't hesitate to ask on the
mailing list. We're here to help! This is simply a reminder of what we are
going to look for before merging your code.
CONTRIBUTING.md
documentFurther Comments
This is a breaking change to the OpenTelemetry API, FWIW.