ref: Add warnings to span streaming APIs (10) #5613
2 issues
Medium
Double warnings emitted when using streaming span decorator in non-span-streaming mode - `sentry_sdk/tracing_utils.py:962-968`
When create_streaming_span_decorator is used in non-span-streaming mode, it emits a warning in the wrapper, then calls start_streaming_span() (which is sentry_sdk.traces.start_span). The start_span function also checks has_span_streaming_enabled() and emits its own warning. This results in two warnings being shown to the user for a single decorated function call, which is noisy and confusing. The decorator should either return early with an alternative execution path (similar to how traces.start_span returns NoOpStreamedSpan), or the warning should be emitted only in one place.
Low
Duplicate warnings emitted when span streaming is not enabled - `sentry_sdk/tracing_utils.py:963-968`
The decorator's async_wrapper and sync_wrapper emit a warning when span streaming is not enabled, then call start_streaming_span (aliased from traces.start_span), which also emits its own warning with a different message and returns a NoOpStreamedSpan. This results in two separate warnings being shown to users each time the decorated function is called without span streaming enabled.
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| code-review | 1 | 2m 53s | $0.74 |
| find-bugs | 1 | 2m 52s | $1.80 |
| skill-scanner | 0 | 1m 16s | $0.37 |
| security-review | 0 | 1m 17s | $0.36 |
Duration: 8m 18s · Tokens: 1.8M in / 21.9k out · Cost: $3.30 (+extraction: $0.01, +fix_gate: $0.00, +dedup: $0.01)