Skip to content

fix(span-list): query all projects in trace mode for cross-project traces#878

Merged
BYK merged 1 commit intomainfrom
fix/span-list-cross-project-735
Apr 29, 2026
Merged

fix(span-list): query all projects in trace mode for cross-project traces#878
BYK merged 1 commit intomainfrom
fix/span-list-cross-project-735

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 29, 2026

Summary

  • Fix empty results when running sentry span list <trace-id> on traces spanning multiple projects
  • Add allProjects option to listSpans() that sends project=-1 to the API, querying across all projects
  • Enable allProjects: true in trace mode — the trace:{id} query already scopes results to the correct trace
  • Project mode (no trace ID) unchanged — continues to scope by project slug

Root Cause

listSpans() always prepended project:{slug} to the query. For cross-project traces, the auto-detected project might not participate in the trace, causing the API to return zero spans.

Test Plan

  • 2 new tests verifying allProjects: true is passed in trace mode and NOT in project mode
  • All 31 span list tests pass

Closes #735

…aces

listSpans() always scoped queries to a single project via project:{slug}.
For traces spanning multiple projects, the auto-detected project might
not participate in the trace, returning empty results.

- Add allProjects option to listSpans that sends project=-1
- Enable allProjects in trace mode since trace:{id} already scopes results
- Project mode unchanged (single-project queries still correct)

Closes #735
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-878/

Built to branch gh-pages at 2026-04-29 01:45 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

6258 passed | Total: 6258 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

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

All tests are passing successfully.

❌ Patch coverage is 64.71%. Project has 13024 uncovered lines.
❌ Project coverage is 75.95%. Comparing base (base) to head (head).

Files with missing lines (1)
File Patch % Lines
src/lib/api/traces.ts 62.50% ⚠️ 6 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    76.00%    75.95%    -0.05%
==========================================
  Files          293       293         —
  Lines        54108     54150       +42
  Branches         0         0         —
==========================================
+ Hits         41121     41126        +5
- Misses       12987     13024       +37
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit d00e01f into main Apr 29, 2026
24 checks passed
@BYK BYK deleted the fix/span-list-cross-project-735 branch April 29, 2026 01:50
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.

bug: sentry span list returns empty for cross-project traces

1 participant