FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

ref(aiohttp): Move crumbs to integration by sentrivana · Pull Request #7135 · getsentry/sentry-python · GitHub

ref(aiohttp): Move crumbs to integration - #7135

Merged
sentrivana merged 26 commits into
masterfrom
ivana/move-http-crumbs-1
Aug 12, 2026
Merged

ref(aiohttp): Move crumbs to integration#7135
sentrivana merged 26 commits into
masterfrom
ivana/move-http-crumbs-1

Conversation

sentrivana commented Aug 7, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Description

Create HTTP client breadcrumbs directly in the aiohttp integration instead of using maybe_create_breadcrumbs_from_span.

👀 Best reviewed with Hide whitespace on.

This turned out to be a bigger change than expected:

  • Breadcrumb data should be on par with what we're sending now. When we were taking it from the span, we had all the data readily available when we needed to create the breadcrumb. When moving the logic to the integration, we now need to remember information from the start request hook because it's not available in the finish request hook, where we create the breadcrumb now. (We need to create the breadcrumb at the end, because it contains stuff like HTTP status code.)
  • Breadcrumb data should be subject to PII filtering from send_default_pii/data_collection. So e.g. if parts of the query have been redacted on a span, they should not appear verbatim in the breadcrumb.
  • Since the PII redacting logic is different between transaction-based tracing and span streaming, the existing crumb tests needed to test both paths, as well as different PII filtering settings.

Additionally:

  • Rename span on the aiohttp trace context to _sentry_span

Issues

Reminders

span: "Union[Span, StreamedSpan, None]"
if has_span_streaming_enabled(client.options):
if sentry_sdk.traces.get_current_span() is None:
span = None

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This had to be moved after the PII redaction, because even if we don't want to create a span, we do want to create a breadcrumb, and we need to apply the same PII redacting logic to breadcrumbs.

scope: "sentry_sdk.Scope", span: "sentry_sdk.tracing.Span"
) -> None:
if span.op == OP.HTTP_CLIENT:
if span.op == OP.HTTP_CLIENT and span.origin not in ("auto.http.aiohttp",):

sentrivana Aug 7, 2026
edited
Loading

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is just here to make sure we're not creating breadcrumbs the old way in transaction-based tracing anymore. Once all HTTP client integrations have been migrated, the whole function will go away

Base automatically changed from ivana/move-redis-breadcrumbs-to-integration to master August 7, 2026 11:33

github-actions Bot commented Aug 7, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Codecov Results 📊

104314 passed | ⏭️ 6677 skipped | Total: 110991 | Pass Rate: 93.98% | Execution Time: 363m 51s

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +330
Passed Tests 📈 +330
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 89.09%. Project has 2478 uncovered lines.
✅ Project coverage is 90.16%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
sentry_sdk/integrations/aiohttp.py 86.05% ⚠️ 6 Missing and 4 partials
sentry_sdk/tracing_utils.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    90.15%    90.16%    +0.01%
==========================================
  Files          193       193         —
  Lines        25147     25171       +24
  Branches      9136      9146       +10
==========================================
+ Hits         22669     22693       +24
- Misses        2478      2478         —
- Partials      1431      1429        -2

Generated by Codecov Action

sentrivana marked this pull request as ready for review August 7, 2026 11:44
sentrivana requested a review from a team as a code owner August 7, 2026 11:44
Comment thread sentry_sdk/integrations/aiohttp.py Outdated
Comment thread sentry_sdk/integrations/aiohttp.py Outdated
sentrivana marked this pull request as draft August 7, 2026 12:17
sentrivana marked this pull request as ready for review August 7, 2026 12:38
Comment thread sentry_sdk/integrations/aiohttp.py Outdated

ericapisani left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Non-blocking question, otherwise LGTM 🚀

Comment thread sentry_sdk/tracing_utils.py Outdated
sentrivana merged commit 9ee8af5 into master Aug 12, 2026
145 checks passed
sentrivana deleted the ivana/move-http-crumbs-1 branch August 12, 2026 11:53
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL