Skip to content

feat(cli): Apply saved dashboard transformations - #2110

Open
nsdeschenes wants to merge 3 commits into
mainfrom
nd/resolve-exp-1410
Open

nsdeschenes wants to merge 3 commits into
mainfrom
nd/resolve-exp-1410

Conversation

@nsdeschenes

@nsdeschenes nsdeschenes commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

These changes make it so sentry dashboard view apply the transformations already saved on supported charts, such as filling gaps or smoothing values. It shows the exact results in tables and JSON, preserves gaps and information about which values were transformed, and honours the saved bucket interval unless you override it with --interval.

🤖 generated description below:


Why

dashboard view ignored saved transformations and converted missing values to zero. Execute the saved transformations through the public time-series endpoint and retain the complete results.

Fixes EXP-1410.

What changed

  • Execute saved span, log, and trace-metric transformations. Preserve duplicate axes, groups, nullable values, units, comparisons, and provenance in JSON and terminal output.
  • Honor saved widget intervals across terminal resizing. Add --interval and expose requested and executed intervals separately.
  • Report unsupported widgets, unavailable features, and servers that ignore transformations explicitly.

Scope

Saved dashboard chart transformations. Explore transformations and transformation editing controls are separate work.

Tradeoffs

Transformed widgets print complete tables below the dashboard grid. This keeps exact values and gaps that the existing stacked and downsampled charts cannot represent faithfully.

Verification

  • TZ=UTC pnpm run tsc and TZ=UTC pnpm run lint pass.
  • All 137 focused request, CLI, rendering, and completion regressions pass.
  • TZ=UTC pnpm run test passed 12,972 CLI tests. The existing musl installer test fails on macOS, and the asset-catalog suite cannot find Xcode's actool.

nsdeschenes and others added 3 commits November 9, 2026 10:48
Execute saved transformations through events-timeseries and retain complete
responses. Print exact values, gaps, and provenance below the dashboard grid.

Refs EXP-1410

Co-Authored-By: GPT-6.1 Sol (Codex) <[email protected]>
Expose --interval for chart requests and record the requested interval
separately from the executed interval returned by Sentry.

Refs EXP-1410

Co-Authored-By: GPT-6.1 Sol (Codex) <[email protected]>
Document supported widgets, complete transformed output, interval precedence,
and explicit unsupported or unavailable results.

Refs EXP-1410

Co-Authored-By: GPT-6.1 Sol (Codex) <[email protected]>
@vercel

vercel Bot commented Nov 9, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
sentry-local Skipped Skipped Nov 9, 2026 2:50pm UTC

Request Review

@linear-code

linear-code Bot commented Nov 9, 2026

Copy link
Copy Markdown

EXP-1410

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3aca1e4. Configure here.

Comment thread packages/cli/src/lib/api/dashboards.ts Resolved
@nsdeschenes
nsdeschenes marked this pull request as ready for review November 9, 2026 15:25
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 9, 2026
nsdeschenes added a commit that referenced this pull request Nov 10, 2026
Dashboard inspection in the CLI and MCP now shows each widget query's
saved transformations by aggregate position, in the order Sentry applies
them. Duplicate aggregates stay separate entries, and widgets without
saved transformations keep their current output. This only inspects
configuration. Live execution is #2110 (EXP-1410).

A shared helper in `@sentry/toolkit-core/dashboard-transformations`
builds the entries for both products. It sorts positions numerically,
keeps the transformation strings exactly as saved, keeps empty lists and
positions that no longer match an aggregate, and writes a description
such as `count() (aggregate 2): smooth(asap,7) → fill(zero)`.

- **MCP `get_dashboard_details`**: each query gets `transformations: [{
aggregateIndex, aggregate, transformations, description }]`. The field
is left out when nothing is saved (`{}`), so current responses don't
change. It is `null` when the server's response has no `transformations`
field (servers from before EXP-1299).
- **CLI `dashboard view`**: adds a "Saved transformations" section under
the grid, grouped by widget and query.
- **CLI `dashboard widget edit`**: lists the saved transformations. It
also fixes a gap: the command used to report the request widget, which
leaves out transformations so Sentry keeps them. Now it reports the
saved widget from the PUT response, so `--json` includes them too.
- CLI JSON keeps the raw `transformations` map, which is keyed by
aggregate position. Its schema field now has a description.

I checked the contract against getsentry/sentry.
`DashboardWidgetQuerySerializer` (in
`api/serializers/models/dashboard.py`) always returns
`obj.transformations or {}`. The write serializer only accepts canonical
numeric indexes and checks
`organizations:explore-interpolation-and-smoothing` on write.

**Open question (feature-disabled):** the GET serializer doesn't check
the feature flag. So an org with the feature off still gets its saved
transformations back, and inspection shows them as saved. This PR
doesn't fetch org features to label that case. If we want an explicit
"saved but feature disabled" marker, that means an extra org lookup.
Happy to add it if reviewers think it's worth it.

Regression coverage uses the existing GET/PUT persistence mock
(`widget/preservation.test.ts`), MCP handler tests against the dashboard
fixture, and unit tests for the shared helper.

Refs
[EXP-1417](https://linear.app/getsentry/issue/EXP-1417/climcp-describe-saved-dashboard-transformations)

<!-- junior-request-attribution:start -->
via **Nick**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0CB5FY8Q9M%3A1794244820.905849 -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0CB5FY8Q9M%3A1794244820.905849)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0CB5FY8Q9M%3A1794244820.905849/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: Nicholas Deschenes <[email protected]>
Co-authored-by: GPT-6.1 Sol <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

This PR has had no activity for 3 days. It closes in 2 days unless someone pushes, comments, or adds the WIP label.

@github-actions github-actions Bot added the Stale label Nov 23, 2026

This branch was previously deployed

1 inactive deployment
Preview — 3aca1e44 Deployed Nov 9, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant