Conversation
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 1, 2026 09:13
5259ffd to
ef993c6
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 1, 2026 12:22
ef993c6 to
5db9c0c
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 1, 2026 12:58
5db9c0c to
3f56f8c
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 2, 2026 07:59
3f56f8c to
220e329
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
2 times, most recently
from
September 4, 2026 13:26
953c46a to
6f348e2
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 7, 2026 11:40
6f348e2 to
fe9727e
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 7, 2026 11:50
fe9727e to
d5377ce
Compare
szokeasaurusrex
approved these changes
Sep 10, 2026
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 16, 2026 09:14
d5377ce to
a851dce
Compare
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 17, 2026 08:38
a851dce to
583b5dd
Compare
Carry isolated scopes through RPC contexts for tracing, capture, request metadata, and panic handling. Continue traces from every incoming baggage metadata value. Preserve caller context values and active child spans when a gateway transaction already exists. Only the interceptor that creates a transaction writes RPC metadata and status or finishes it, for both unary and streaming calls.
giortzisg
force-pushed
the
scopes/grpc-server-integration
branch
from
September 17, 2026 09:09
583b5dd to
a40929e
Compare
Comment on lines
+88
to
+91
| if service != "" { | ||
| transaction.SetData("rpc.service", service) | ||
| } | ||
| if method != "" { |
There was a problem hiding this comment.
Bug: When a parent span exists, a new transaction is created but not added to the context or finished, leading to lost child span data.
Severity: MEDIUM
Suggested Fix
When owned == false, avoid creating a new, orphaned transaction. The logic should either retrieve and use the existing transaction from the parent context or, if a new transaction is strictly necessary, ensure it is properly finished. The current implementation, which creates and then discards a transaction without finishing it, should be corrected to prevent data loss.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.
Location: grpc/server.go#L88-L91
Potential issue: In the `startServerTransaction` function, when a parent span already
exists (the `owned == false` case), a new transaction is created but is never finished,
nor is it added to the context returned to the handler. This creates an inconsistent
state. If the handler or subsequent logic creates child spans using this new, unfinished
`transaction` object, those child spans are recorded but will never be sent to Sentry
because their parent transaction is never completed. This results in silently lost
tracing data for nested operations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This migrates the grpc integration to use the new scopes API.
Issues
Changelog Entry Instructions
To add a custom changelog entry, uncomment the section above. Supports:
For more details: custom changelog entries
Reminders
feat:,fix:,ref:,meta:)Stack created with GitHub Stacks CLI • Give Feedback 💬