Repository navigation
feat(test-grpc): Migrate to streamed spans - #105
Merged
Merged
Conversation
Under trace_lifecycle="stream", sentry_sdk.start_transaction() returns a NoOpSpan and records nothing. Replace the 3 live start_transaction calls (main.py, client.py, client-async.py) with sentry_sdk.traces.start_span(), which is the API that actually creates a real span under streaming. server.py and server-async.py had no start_transaction/start_span calls to convert; no @sentry_sdk.trace decorators were found in the project. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TTtVSwfTGeB9RQzf3Pv8SE
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.
Summary
test-grpcalready hastrace_lifecycle="stream"(merged), under whichsentry_sdk.start_transaction()and the top-levelsentry_sdk.start_span()both returnNoOpSpanand record nothing.start_transactioncalls withsentry_sdk.traces.start_span(...), the API that creates a real span under streaming:main.py:start_transaction(op="function", name="clickhouse_driver")→sentry_sdk.traces.start_span(name="clickhouse_driver", attributes={"sentry.op": "function"})client.py:start_transaction(op="function", name="grcp_client")→sentry_sdk.traces.start_span(name="grcp_client", attributes={"sentry.op": "function"})client-async.py:start_transaction(op="function", name="grcp_client")→sentry_sdk.traces.start_span(name="grcp_client", attributes={"sentry.op": "function"})import sentry_sdk.tracesto each edited file (not re-exported fromsentry_sdk/__init__.py).server.pyandserver-async.pywere checked but contain nostart_transaction/start_spancalls — nothing to convert. No@sentry_sdk.tracedecorators found anywhere in the project.TypeError("xyz!")inclient.py,1/0inserver-async.py) inside the traced blocks, unchanged.Test plan
python -m py_compileon all 5 checked files (main.py, client.py, client-async.py, server.py, server-async.py)grep -rn "start_transaction\|sentry_sdk.start_span" test-grpcreturns no matches🤖 Generated with Claude Code
https://claude.ai/code/session_01TTtVSwfTGeB9RQzf3Pv8SE