Skip to content

Commit a0198f4

Browse files
betegonclaude
andcommitted
refactor(dashboard): remove widget types command, put all info in widget --help
Removes the standalone `sentry dashboard widget types` command. All the info (display types, sizes, datasets, aggregates, aliases, row-filling examples) now lives directly in `sentry dashboard widget --help` so agents get it immediately without running a separate command. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 4278a1f commit a0198f4

9 files changed

Lines changed: 30 additions & 384 deletions

File tree

docs/src/content/docs/agent-guidance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ Use **common** types for general dashboards. Use **specialized** only when speci
129129

130130
Available datasets: `spans` (default, covers most use cases), `discover`, `issue`, `error-events`, `transaction-like`, `metrics`, `logs`.
131131

132-
Run `sentry dashboard widget types --json` for the full machine-readable list including aggregate functions.
132+
Run `sentry dashboard widget --help` for the full list including aggregate functions.
133133

134134
**Row-filling examples:**
135135

docs/src/content/docs/commands/dashboard.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -323,25 +323,3 @@ sentry dashboard widget delete 'My Dashboard' --title 'Error Count'
323323
# Delete by index
324324
sentry dashboard widget delete 12345 --index 2
325325
```
326-
327-
### `sentry dashboard widget types`
328-
329-
Show available widget display types with default grid sizes, datasets, and aggregate functions.
330-
331-
Sentry dashboards use a 6-column grid. This command helps you understand the available options and how widgets fit into the layout.
332-
333-
```bash
334-
# Human-readable table
335-
sentry dashboard widget types
336-
337-
# Machine-readable JSON (recommended for agents)
338-
sentry dashboard widget types --json
339-
```
340-
341-
Display types are categorized as:
342-
343-
| Category | Types | When to use |
344-
|----------|-------|------------|
345-
| common | `big_number`, `line`, `area`, `bar`, `table` | General-purpose dashboards |
346-
| specialized | `stacked_area`, `top_n`, `categorical_bar`, `text` | Specific use cases |
347-
| internal | `details`, `wheel`, `rage_and_dead_clicks`, `server_tree`, `agents_traces_table` | Sentry-internal, rarely used directly |

plugins/sentry-cli/skills/sentry-cli/SKILL.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ Use **common** types for general dashboards. Use **specialized** only when speci
139139

140140
Available datasets: `spans` (default, covers most use cases), `discover`, `issue`, `error-events`, `transaction-like`, `metrics`, `logs`.
141141

142-
Run `sentry dashboard widget types --json` for the full machine-readable list including aggregate functions.
142+
Run `sentry dashboard widget --help` for the full list including aggregate functions.
143143

144144
**Row-filling examples:**
145145

@@ -276,7 +276,6 @@ Manage Sentry dashboards
276276
- `sentry dashboard widget add <args...>` — Add a widget to a dashboard
277277
- `sentry dashboard widget edit <args...>` — Edit a widget in a dashboard
278278
- `sentry dashboard widget delete <args...>` — Delete a widget from a dashboard
279-
- `sentry dashboard widget types <args...>` — Show available widget display types and layout info
280279

281280
→ Full flags and examples: `references/dashboards.md`
282281

plugins/sentry-cli/skills/sentry-cli/references/dashboards.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,4 @@ Delete a widget from a dashboard
122122
- `-i, --index <value> - Widget index (0-based)`
123123
- `-t, --title <value> - Widget title to match`
124124

125-
### `sentry dashboard widget types <args...>`
126-
127-
Show available widget display types and layout info
128-
129125
All commands also support `--json`, `--fields`, `--help`, `--log-level`, and `--verbose` flags.

src/commands/dashboard/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const dashboardRoute = buildRouteMap({
1919
" list List dashboards\n" +
2020
" view View a dashboard\n" +
2121
" create Create a dashboard\n" +
22-
" widget Manage dashboard widgets (add, edit, delete, types)",
22+
" widget Manage dashboard widgets (add, edit, delete)",
2323
hideRoute: {},
2424
},
2525
});

src/commands/dashboard/widget/index.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@ import { buildRouteMap } from "@stricli/core";
22
import { addCommand } from "./add.js";
33
import { deleteCommand } from "./delete.js";
44
import { editCommand } from "./edit.js";
5-
import { typesCommand } from "./types.js";
65

76
export const widgetRoute = buildRouteMap({
87
routes: {
98
add: addCommand,
109
edit: editCommand,
1110
delete: deleteCommand,
12-
types: typesCommand,
1311
},
1412
docs: {
1513
brief: "Manage dashboard widgets",
@@ -19,13 +17,33 @@ export const widgetRoute = buildRouteMap({
1917
"Display types (width × height):\n" +
2018
" common: big_number (2×1), line (3×2), area (3×2), bar (3×2), table (6×2)\n" +
2119
" specialized: stacked_area (3×2), top_n (3×2), categorical_bar (3×2), text (3×2)\n" +
22-
" internal: details, wheel, rage_and_dead_clicks, server_tree, agents_traces_table (3×2)\n\n" +
23-
"Default dataset: spans. Run 'sentry dashboard widget types' for the full list.\n\n" +
20+
" internal: details (3×2), wheel (3×2), rage_and_dead_clicks (3×2),\n" +
21+
" server_tree (3×2), agents_traces_table (3×2)\n\n" +
22+
"Datasets: spans (default), discover, issue, error-events, transaction-like,\n" +
23+
" metrics, logs, tracemetrics, preprod-app-size\n\n" +
24+
"Aggregates (spans): count, count_unique, sum, avg, percentile, p50, p75,\n" +
25+
" p90, p95, p99, p100, eps, epm, any, min, max\n" +
26+
"Aggregates (discover adds): failure_count, failure_rate, apdex,\n" +
27+
" count_miserable, user_misery, count_web_vitals, count_if, count_at_least,\n" +
28+
" last_seen, latest_event, var, stddev, cov, corr, performance_score,\n" +
29+
" opportunity_score, count_scores\n" +
30+
"Aliases: spm → epm, sps → eps, tpm → epm, tps → eps\n\n" +
31+
"Row-filling examples:\n" +
32+
" # 3 KPIs (2+2+2 = 6)\n" +
33+
' sentry dashboard widget add <d> "Error Count" --display big_number --query count\n' +
34+
' sentry dashboard widget add <d> "P95" --display big_number --query p95:span.duration\n' +
35+
' sentry dashboard widget add <d> "Throughput" --display big_number --query epm\n\n' +
36+
" # 2 charts (3+3 = 6)\n" +
37+
' sentry dashboard widget add <d> "Errors" --display line --query count\n' +
38+
' sentry dashboard widget add <d> "Latency" --display line --query p95:span.duration\n\n' +
39+
" # Full-width table (6 = 6)\n" +
40+
' sentry dashboard widget add <d> "Top Endpoints" --display table \\\n' +
41+
" --query count --query p95:span.duration --group-by transaction \\\n" +
42+
" --sort -count --limit 10\n\n" +
2443
"Commands:\n" +
2544
" add Add a widget to a dashboard\n" +
2645
" edit Edit a widget in a dashboard\n" +
27-
" delete Delete a widget from a dashboard\n" +
28-
" types Show available display types and layout info",
46+
" delete Delete a widget from a dashboard",
2947
hideRoute: {},
3048
},
3149
});

src/commands/dashboard/widget/types.ts

Lines changed: 0 additions & 184 deletions
This file was deleted.

src/types/dashboard.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -479,10 +479,10 @@ export function prepareWidgetQueries(widget: DashboardWidget): DashboardWidget {
479479
// ---------------------------------------------------------------------------
480480

481481
/** Sentry dashboard grid column count */
482-
export const GRID_COLUMNS = 6;
482+
const GRID_COLUMNS = 6;
483483

484484
/** Default widget dimensions by displayType */
485-
export const DEFAULT_WIDGET_SIZE: Partial<
485+
const DEFAULT_WIDGET_SIZE: Partial<
486486
Record<DisplayType, { w: number; h: number; minH: number }>
487487
> = {
488488
big_number: { w: 2, h: 1, minH: 1 },
@@ -491,7 +491,7 @@ export const DEFAULT_WIDGET_SIZE: Partial<
491491
bar: { w: 3, h: 2, minH: 2 },
492492
table: { w: 6, h: 2, minH: 2 },
493493
};
494-
export const FALLBACK_SIZE = { w: 3, h: 2, minH: 2 };
494+
const FALLBACK_SIZE = { w: 3, h: 2, minH: 2 };
495495

496496
/** Build a set of occupied grid cells and the max bottom edge from existing layouts. */
497497
function buildOccupiedGrid(widgets: DashboardWidget[]): {

0 commit comments

Comments
 (0)