Skip to content
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

Add grpc sent event before sending the message #11413

Closed
wants to merge 1 commit into from

Conversation

laurit
Copy link
Contributor

@laurit laurit commented May 21, 2024

Hopefully fixes https://ge.opentelemetry.io/s/vs6vvuevyrcss/tests/task/:instrumentation:grpc-1.6:library:test/details/io.opentelemetry.instrumentation.grpc.v1_6.GrpcStreamingTest/conversation(int%2C%20int)%5B9%5D?top-execution=1
Currently it is possible that RECEIVED event appears before SENT event. Alternatively we could rework the assertion so that it would not fail when the order of the events is swapped. These events were introduced in #4098 @trask do you review whether moving adding the event before sendMessage is ok.

@laurit laurit requested a review from a team May 21, 2024 07:56
Span span = Span.fromContext(context);
Attributes attributes =
Attributes.of(MESSAGE_TYPE, SENT, MESSAGE_ID, MESSAGE_ID_UPDATER.incrementAndGet(this));
span.addEvent("message", attributes);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking (guessing) that it's better to only emit the event when the message is successfully sent (or if we're going to emit it when it fails to note the failure somehow in the event that is emitted)

I think it's fine to loosen the assertion ordering constraint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants