Skip to content

feat(stdlib): Support data_collection filtering for URL query params - #7291

Merged
ericapisani merged 4 commits into
masterfrom
py-2744-stdlib-datacollection
Aug 31, 2026
Merged

feat(stdlib): Support data_collection filtering for URL query params#7291
ericapisani merged 4 commits into
masterfrom
py-2744-stdlib-datacollection

Conversation

@ericapisani

@ericapisani ericapisani commented Aug 28, 2026

Copy link
Copy Markdown
Member

Previously the stdlib httplib integration only gated url.full, url.query and
url.fragment on send_default_pii, so with data_collection configured the URL
data was dropped entirely and no allow/denylist filtering was ever applied.
The data_collection experiment's url_query_params behaviour is now applied to
span streaming spans and breadcrumbs, matching httpx and pyreqwest.

url.full is now reassembled with the filtered query and fragment, and empty
url.query/url.fragment attributes are no longer emitted. The legacy
(non span-streaming) path is left unchanged.

Fixes PY-2744
Fixes #7279

@linear-code

linear-code Bot commented Aug 28, 2026

Copy link
Copy Markdown

PY-2744

@ericapisani
ericapisani marked this pull request as ready for review August 28, 2026 18:08
@ericapisani
ericapisani requested a review from a team as a code owner August 28, 2026 18:08
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

121810 passed | ⏭️ 6762 skipped | Total: 128572 | Pass Rate: 94.74% | Execution Time: 432m 39s

📊 Comparison with Base Branch

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

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2489 uncovered lines.
❌ Project coverage is 90.28%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
sentry_sdk/tracing_utils.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    90.30%    90.28%    -0.02%
==========================================
  Files          193       193         —
  Lines        25612     25612         —
  Branches      9450      9434       -16
==========================================
+ Hits         23129     23123        -6
- Misses        2483      2489        +6
- Partials      1434      1436        +2

Generated by Codecov Action

Base automatically changed from py-2745-boto3-data-collection to master August 31, 2026 14:49
Previously the stdlib httplib integration only gated url.full, url.query and
url.fragment on send_default_pii, so with data_collection configured the URL
data was dropped entirely and no allow/denylist filtering was ever applied.
The data_collection experiment's url_query_params behaviour is now applied to
span streaming spans and breadcrumbs, matching httpx and pyreqwest.

url.full is now reassembled with the filtered query and fragment, and empty
url.query/url.fragment attributes are no longer emitted. The legacy
(non span-streaming) path is left unchanged.

Fixes PY-2744
Fixes #7279
The stdlib integration no longer emits empty url.query and url.fragment
attributes, so the requests breadcrumb tests were asserting on data that
is intentionally absent.
boto3, httpx, httpx2, pyreqwest, and stdlib each defined an identical
`_get_url_attributes` function for building `url.*` span attributes with
data_collection/PII filtering. Consolidate into a single
`get_url_attributes` in tracing_utils.py and have each integration call it.

Refs PY-2744
Refs #7279
@ericapisani
ericapisani force-pushed the py-2744-stdlib-datacollection branch from 0312f9c to 8cc46e2 Compare August 31, 2026 14:49
@ericapisani
ericapisani merged commit c2d2956 into master Aug 31, 2026
139 checks passed
@ericapisani
ericapisani deleted the py-2744-stdlib-datacollection branch August 31, 2026 15:05
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.

Update stdlib integration to support data collection

2 participants