Skip to content

fix(boto3): Fix botocore SigV4 failures caused by post-sign trace propagation - #7050

Draft
pabloDeputter wants to merge 2 commits into
masterfrom
pablo/fix-botocore-sigv4-trace-propagation
Draft

fix(boto3): Fix botocore SigV4 failures caused by post-sign trace propagation#7050
pabloDeputter wants to merge 2 commits into
masterfrom
pablo/fix-botocore-sigv4-trace-propagation

Conversation

@pabloDeputter

Copy link
Copy Markdown
Member

WIP!

Description

  • merge Sentry baggage with existing vendor (e.g. Datadog) baggage in botocore'sbefore-sign hook; avoiding post-sign header tampering that invalidates the SigV4 signature.
  • Skip propagation for presigned requests

Issues

Resolves: #7031 & PY-2667

Reminders

- merge Sentry baggage with existing vendor (e.g. Datadog) baggage in botocore's`before-sign` hook; avoiding post-sign header tampering that invalidates the SigV4 signature.
- Skip propagation for presigned requests

Fixes: #7031 & PY-2667
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

96711 passed | ❌ 1 failed | ⏭️ 6191 skipped | Total: 102903 | Pass Rate: 93.98% | Execution Time: 348m 30s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests 📉 -1
Failed Tests 📈 +1
Skipped Tests

➕ New Tests (1)

View new tests
  • test_continuous_profiler_auto_start_and_stop_sampled_span_streaming[non-experiment-thread]
    • File: tests.profiler.test_continuous_profiler
    • Status: ❌ Failing

❌ Failed Tests

test_continuous_profiler_auto_start_and_stop_sampled_span_streaming[non-experiment-thread]

File: tests.profiler.test_continuous_profiler
Suite: py3.7-common
Error: AssertionError: profiler should not be running assert 'f5dabaf9cc614ef5a7a26765b84e4360' is None + where 'f5dabaf9cc614ef5a7a26765b84e4360' = get_profiler_id()

Stack Trace
tests/profiler/test_continuous_profiler.py:896: in test_continuous_profiler_auto_start_and_stop_sampled_span_streaming
    assert get_profiler_id() is None, "profiler should not be running"
E   AssertionError: profiler should not be running
E   assert 'f5dabaf9cc614ef5a7a26765b84e4360' is None
E    +  where 'f5dabaf9cc614ef5a7a26765b84e4360' = get_profiler_id()

✅ Patch coverage is 81.48%. Project has 2513 uncovered lines.
✅ Project coverage is 89.91%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
sentry_sdk/integrations/stdlib.py 80.00% ⚠️ 11 Missing and 4 partials
sentry_sdk/integrations/boto3.py 84.62% ⚠️ 4 Missing and 4 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.90%    89.91%    +0.01%
==========================================
  Files          193       193         —
  Lines        24822     24896       +74
  Branches      8924      8958       +34
==========================================
+ Hits         22315     22383       +68
- Misses        2507      2513        +6
- Partials      1417      1423        +6

Generated by Codecov Action

- trace-header injection is delayed until `endheaders()` after all request headers are available.
- avoid duplicate propagation headers.
- no tampering/modifying of already signed baggage

Fixes: #7031 & PY-2667
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

S3 HeadObject returns 403 when sentry_sdk.start_span and Datadog botocore instrumentation are both active

1 participant