Skip to content

feat(chalice): Add span streaming support to Chalice integration#6503

Merged
ericapisani merged 12 commits into
masterfrom
py-2312-migrate-chalice
Jun 12, 2026
Merged

feat(chalice): Add span streaming support to Chalice integration#6503
ericapisani merged 12 commits into
masterfrom
py-2312-migrate-chalice

Merge branch 'master' into py-2312-migrate-chalice

51cf45a
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden completed Jun 11, 2026 in 13m 54s

2 issues

Medium

Missing transaction name on scope in streaming mode when no active segment span exists - `sentry_sdk/integrations/chalice.py:21`

In _get_view_function_response, when span streaming is enabled (has_span_streaming_enabled) but no StreamedSpan segment is active (e.g. the Chalice app runs without the AWS Lambda integration, which is the only thing that creates the segment), segment stays None and the streaming branch never calls scope.set_transaction_name(...). Errors are still captured via capture_event, but the resulting events carry no transaction context. The non-streaming else branch always sets scope.set_transaction_name(app.lambda_context.function_name, source=TransactionSource.COMPONENT), so for any setup without an active segment this is a behavioral regression where error/message events lose their transaction name.

Also found at:

  • tests/integrations/chalice/test_chalice.py:199-236

Low

Streaming path with no existing segment has no test coverage and silently produces no trace data on success - `sentry_sdk/integrations/chalice.py:88-91`

When has_span_streaming_enabled is True but no StreamedSpan is current (e.g. Chalice used without the AWS Lambda integration), segment stays None and a successful request returns without creating any span or setting a transaction name — no trace data is recorded at all. Only the error path calls client.flush(). Consider adding a test asserting the expected behavior in this case, or a guard that falls back to the else branch.

Also found at:

  • tests/integrations/chalice/test_chalice.py:176
4 skills analyzed
Skill Findings Duration Cost
security-review 0 3.4s $0.01
code-review 1 4m 44s $0.76
find-bugs 1 12m 29s $2.76
skill-scanner 0 14.5s $0.01

⏱ 17m 30s · 2.3M in / 119.6k out · $3.54