Skip to content

Conversation

@glbrntt
Copy link
Collaborator

@glbrntt glbrntt commented Nov 24, 2025

Motivation:

The OTel tracing interceptors had a number of issues. The most important was that spans were ended too early in their lifecycle. Others included not always setting the span status or grpc status code attribute.

Modifications:

  • Start and end spans manually
  • Replace the hooked async sequence with custom sequnces for server request messages and client response messages. This allows the atomic to be dropped in favour of a simple integer stored on the iterator.
  • Replace the hooked async writer with a more targeted tracing writer

Result:

Tracing interceptors are more reliable

Motivation:

The OTel tracing interceptors had a number of issues. The most important
was that spans were ended too early in their lifecycle. Others included
not always setting the span status or grpc status code attribute.

Modifications:

- Start and end spans manually
- Replace the hooked async sequence with custom sequnces for server
  request messages and client response messages. This allows the atomic
  to be dropped in favour of a simple integer stored on the iterator.
- Replace the hooked async writer with a more targeted tracing writer

Result:

Tracing interceptors are more reliable
@glbrntt glbrntt added the 🔨 semver/patch No public API change. label Nov 24, 2025
@glbrntt glbrntt merged commit 7ab4a69 into grpc:main Nov 25, 2025
35 checks passed
@glbrntt glbrntt deleted the tracing branch November 25, 2025 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants