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

census: Trace annotation for reporting inbound message sizes #9944

Merged
merged 2 commits into from
Mar 11, 2023

Conversation

DNVindhya
Copy link
Contributor

This PR uses OpenCensus Annotation to report message size [bytes] for inbound/received messages in traces.

addMessageEvent API which is currently used expects both uncompressed and compressed message (optional) sizes to be reported at the same. Since decompression for messages happens at a later point in time, reporting compressed message as is and reporting uncompressed size as -1 renders the size as 0 bytes received in cloud tracing front end.

As a workaround, we add two annotations for each received message:

  • For compressed message size
  • For uncompressed message size (when it is available)

This PR also removes addMessageEvents a flag introduced in PR #9485 to temporarily suppress message events for gcp-observability

CC @ejona86 @sanjaypujare

@ejona86 ejona86 merged commit b09473b into grpc:master Mar 11, 2023
@DNVindhya DNVindhya deleted the census-trace-annotation branch March 11, 2023 00:38
DNVindhya added a commit to DNVindhya/grpc-java that referenced this pull request Mar 13, 2023
This commit uses [OpenCensus Annotation][] to report message size
[bytes] for inbound/received messages in traces.

`addMessageEvent` API which is currently used expects both uncompressed
and compressed message (optional) sizes to be reported at the same.
Since decompression for messages happens at a later point in time,
reporting compressed message as is and reporting uncompressed size as
`-1` renders the size as _0 bytes received_ in cloud tracing front end.

As a workaround, we add _two annotations for each received message_:
* For compressed message size
* For uncompressed message size (when it is available)

This commit also removes `addMessageEvents` a flag introduced in
PR grpc#9485 to temporarily suppress message events for gcp-observability.

[OpenCensus Annotation]: https://www.javadoc.io/static/io.opencensus/opencensus-api/0.31.0/io/opencensus/trace/Annotation.html
ejona86 pushed a commit that referenced this pull request Mar 13, 2023
This commit uses [OpenCensus Annotation][] to report message size
[bytes] for inbound/received messages in traces.

`addMessageEvent` API which is currently used expects both uncompressed
and compressed message (optional) sizes to be reported at the same.
Since decompression for messages happens at a later point in time,
reporting compressed message as is and reporting uncompressed size as
`-1` renders the size as _0 bytes received_ in cloud tracing front end.

As a workaround, we add _two annotations for each received message_:
* For compressed message size
* For uncompressed message size (when it is available)

This commit also removes `addMessageEvents` a flag introduced in
PR #9485 to temporarily suppress message events for gcp-observability.

[OpenCensus Annotation]: https://www.javadoc.io/static/io.opencensus/opencensus-api/0.31.0/io/opencensus/trace/Annotation.html
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants