Skip to content

fix(asgi): Add url.path to ASGI request span attributes - #6652

Merged
ericapisani merged 1 commit into
masterfrom
py-2551-asgi-missing-url-path
Jun 25, 2026
Merged

fix(asgi): Add url.path to ASGI request span attributes#6652
ericapisani merged 1 commit into
masterfrom
py-2551-asgi-missing-url-path

Conversation

@ericapisani

@ericapisani ericapisani commented Jun 24, 2026

Copy link
Copy Markdown
Member

The ASGI integration was not setting url.path on streamed request spans. Add it by combining root_path and path from the ASGI scope, which correctly handles sub-mounted apps where root_path is non-empty.

Fixes PY-2551
Fixes #6651

The ASGI integration was missing the url.path attribute on streamed request
spans. Add it by concatenating root_path and path from the ASGI scope,
which correctly handles sub-mounted apps where root_path is non-empty.

Refs PY-2551
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Jun 24, 2026

Copy link
Copy Markdown
@ericapisani
ericapisani marked this pull request as ready for review June 24, 2026 14:51
@ericapisani
ericapisani requested a review from a team as a code owner June 24, 2026 14:51
@github-actions

github-actions Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Codecov Results 📊

89842 passed | ⏭️ 6240 skipped | Total: 96082 | Pass Rate: 93.51% | Execution Time: 320m 42s

📊 Comparison with Base Branch

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

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 2396 uncovered lines.
✅ Project coverage is 89.92%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    89.89%    89.92%    +0.03%
==========================================
  Files          192       192         —
  Lines        23763     23764        +1
  Branches      8206      8206         —
==========================================
+ Hits         21360     21368        +8
- Misses        2403      2396        -7
- Partials      1343      1343         —

Generated by Codecov Action

Comment thread sentry_sdk/integrations/_asgi_common.py
@ericapisani
ericapisani merged commit 72a7248 into master Jun 25, 2026
270 of 272 checks passed
@ericapisani
ericapisani deleted the py-2551-asgi-missing-url-path branch June 25, 2026 13:08
mgaligniana pushed a commit to mgaligniana/sentry-python that referenced this pull request Aug 9, 2026
The ASGI integration was not setting `url.path` on streamed request
spans. Add it by combining `root_path` and `path` from the ASGI scope,
which correctly handles sub-mounted apps where `root_path` is non-empty.

Fixes PY-2551
Fixes getsentry#6651
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants