Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(httpx): Prevent Sentry baggage duplication #3728

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

szokeasaurusrex
Copy link
Member

Sentry baggage will get added to an HTTPX request multiple times if the same request is repeated. To prevent this from occurring, we can strip any existing Sentry baggage before adding Sentry baggage to the request.

Fixes #3709

Sentry baggage will get added to an HTTPX request multiple times if the same request is repeated. To prevent this from occurring, we can strip any existing Sentry baggage before adding Sentry baggage to the request.

Fixes #3709
Copy link

codecov bot commented Nov 4, 2024

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
13722 1 13721 4118
View the top 1 failed tests by shortest run time
tests.integrations.asgi.test_asgi test_auto_session_tracking_with_aggregates
Stack Traces | 0.094s run time
.../integrations/asgi/test_asgi.py:413: in test_auto_session_tracking_with_aggregates
    assert session_aggregates[0]["exited"] == 2
E   assert 1 == 2

To view more test analytics, go to the Test Analytics Dashboard
Got feedback? Let us know on Github

Copy link
Contributor

@sentrivana sentrivana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a typo. Overall looks good to me. Can we also add an httpx test specifically for the scenario where we were accumulating baggage?

sentry_sdk/integrations/httpx.py Outdated Show resolved Hide resolved
Co-authored-by: Ivana Kellyer <ivana.kellyer@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants