Skip to content

fix(explore): use tracemetrics dataset instead of metricsEnhanced#995

Merged
MathurAditya724 merged 1 commit into
mainfrom
issue-994-tracemetrics-dataset
May 21, 2026
Merged

fix(explore): use tracemetrics dataset instead of metricsEnhanced#995
MathurAditya724 merged 1 commit into
mainfrom
issue-994-tracemetrics-dataset

Conversation

@MathurAditya724
Copy link
Copy Markdown
Member

--dataset metrics and --metric auto-resolver were sending dataset=metricsEnhanced to the Events API, which routes to the legacy metrics_enhanced_performance backend. SDK v10 trace metrics live in the tracemetrics dataset (backed by TraceMetrics), which is what the Sentry Explore Metrics UI uses. Switched all metrics-related API calls to tracemetrics.

Testing

bun test test/commands/explore.test.ts — 37/38 pass (1 pre-existing failure from missing api-schema.json).
bun test test/types/dashboard.test.ts — 96/96 pass.
bun test test/commands/dashboard/resolve.test.ts — 76/76 pass.
bun test test/lib/metrics-transform.test.ts — 10/10 pass.

Fixes #994

The `--dataset metrics` flag and `--metric` auto-resolver were sending
`dataset=metricsEnhanced` to the Sentry Events API, which routes to the
legacy metrics_enhanced_performance backend. SDK v10 trace metrics
(`Sentry.metrics.count()` etc.) are stored in the `tracemetrics` dataset
(backed by the TraceMetrics query engine), which is what the Sentry
Explore Metrics UI uses.

Switch all metrics-related API calls from `metricsEnhanced` to
`tracemetrics` so `sentry explore --metric <name>` can resolve SDK v10
trace metrics.

Fixes #994
@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-995/

Built to branch gh-pages at 2026-05-21 04:20 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

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

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 71.43%. Project has 14776 uncovered lines.
✅ Project coverage is 76.61%. Comparing base (base) to head (head).

Files with missing lines (2)
File Patch % Lines
src/commands/explore.ts 80.00% ⚠️ 1 Missing
src/lib/api/discover.ts 0.00% ⚠️ 1 Missing
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    76.55%    76.61%    +0.06%
==========================================
  Files          324       324         —
  Lines        63217     63171       -46
  Branches         0         0         —
==========================================
+ Hits         48395     48395         —
- Misses       14822     14776       -46
- Partials         0         0         —

Generated by Codecov Action

@MathurAditya724 MathurAditya724 marked this pull request as ready for review May 21, 2026 04:29
@MathurAditya724
Copy link
Copy Markdown
Member Author

all 26 CI checks green, self-review looks clean — marked ready for review.

@MathurAditya724
Copy link
Copy Markdown
Member Author

skipping auto-merge: 7 files changed exceeds the 5-file threshold for auto-merge, leaving for human review.

@MathurAditya724 MathurAditya724 merged commit 1c97cbf into main May 21, 2026
27 checks passed
@MathurAditya724 MathurAditya724 deleted the issue-994-tracemetrics-dataset branch May 21, 2026 07:41
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.

explore --metric uses wrong dataset for trace metrics

1 participant