Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions docs/src/content/docs/agent-guidance.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,53 @@ sentry api /api/0/organizations/my-org/
sentry api /api/0/organizations/my-org/projects/ --method POST --data '{"name":"new-project","platform":"python"}'
```

## Dashboard Layout

Sentry dashboards use a **6-column grid**. When adding widgets, aim to fill complete rows (widths should sum to 6).

Display types with default sizes:

| Display Type | Width | Height | Category | Notes |
|---|---|---|---|---|
| `big_number` | 2 | 1 | common | Compact KPI — place 3 per row (2+2+2=6) |
| `line` | 3 | 2 | common | Half-width chart — place 2 per row (3+3=6) |
| `area` | 3 | 2 | common | Half-width chart — place 2 per row |
| `bar` | 3 | 2 | common | Half-width chart — place 2 per row |
| `table` | 6 | 2 | common | Full-width — always takes its own row |
| `stacked_area` | 3 | 2 | specialized | Stacked area chart |
| `top_n` | 3 | 2 | specialized | Top N ranked list |
| `categorical_bar` | 3 | 2 | specialized | Categorical bar chart |
| `text` | 3 | 2 | specialized | Static text/markdown widget |
| `details` | 3 | 2 | internal | Detail view |
| `wheel` | 3 | 2 | internal | Pie/wheel chart |
| `rage_and_dead_clicks` | 3 | 2 | internal | Rage/dead click visualization |
| `server_tree` | 3 | 2 | internal | Hierarchical tree display |
| `agents_traces_table` | 3 | 2 | internal | Agents traces table |

Use **common** types for general dashboards. Use **specialized** only when specifically requested. Avoid **internal** types unless the user explicitly asks.

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

Run `sentry dashboard widget --help` for the full list including aggregate functions.

**Row-filling examples:**

```bash
# 3 KPIs filling one row (2+2+2 = 6)
sentry dashboard widget add <dashboard> "Error Count" --display big_number --query count
sentry dashboard widget add <dashboard> "P95 Duration" --display big_number --query p95:span.duration
sentry dashboard widget add <dashboard> "Throughput" --display big_number --query epm

# 2 charts filling one row (3+3 = 6)
sentry dashboard widget add <dashboard> "Errors Over Time" --display line --query count
sentry dashboard widget add <dashboard> "Latency Over Time" --display line --query p95:span.duration

# Full-width table (6 = 6)
sentry dashboard widget add <dashboard> "Top Endpoints" --display table \
--query count --query p95:span.duration \
--group-by transaction --sort -count --limit 10
```

## Common Mistakes

- **Wrong issue ID format**: Use `PROJECT-123` (short ID), not the numeric ID `123456789`. The short ID includes the project prefix.
Expand Down
47 changes: 47 additions & 0 deletions plugins/sentry-cli/skills/sentry-cli/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,53 @@ sentry api /api/0/organizations/my-org/
sentry api /api/0/organizations/my-org/projects/ --method POST --data '{"name":"new-project","platform":"python"}'
```

### Dashboard Layout

Sentry dashboards use a **6-column grid**. When adding widgets, aim to fill complete rows (widths should sum to 6).

Display types with default sizes:

| Display Type | Width | Height | Category | Notes |
|---|---|---|---|---|
| `big_number` | 2 | 1 | common | Compact KPI — place 3 per row (2+2+2=6) |
| `line` | 3 | 2 | common | Half-width chart — place 2 per row (3+3=6) |
| `area` | 3 | 2 | common | Half-width chart — place 2 per row |
| `bar` | 3 | 2 | common | Half-width chart — place 2 per row |
| `table` | 6 | 2 | common | Full-width — always takes its own row |
| `stacked_area` | 3 | 2 | specialized | Stacked area chart |
| `top_n` | 3 | 2 | specialized | Top N ranked list |
| `categorical_bar` | 3 | 2 | specialized | Categorical bar chart |
| `text` | 3 | 2 | specialized | Static text/markdown widget |
| `details` | 3 | 2 | internal | Detail view |
| `wheel` | 3 | 2 | internal | Pie/wheel chart |
| `rage_and_dead_clicks` | 3 | 2 | internal | Rage/dead click visualization |
| `server_tree` | 3 | 2 | internal | Hierarchical tree display |
| `agents_traces_table` | 3 | 2 | internal | Agents traces table |

Use **common** types for general dashboards. Use **specialized** only when specifically requested. Avoid **internal** types unless the user explicitly asks.

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

Run `sentry dashboard widget --help` for the full list including aggregate functions.

**Row-filling examples:**

```bash
# 3 KPIs filling one row (2+2+2 = 6)
sentry dashboard widget add <dashboard> "Error Count" --display big_number --query count
sentry dashboard widget add <dashboard> "P95 Duration" --display big_number --query p95:span.duration
sentry dashboard widget add <dashboard> "Throughput" --display big_number --query epm

# 2 charts filling one row (3+3 = 6)
sentry dashboard widget add <dashboard> "Errors Over Time" --display line --query count
sentry dashboard widget add <dashboard> "Latency Over Time" --display line --query p95:span.duration

# Full-width table (6 = 6)
sentry dashboard widget add <dashboard> "Top Endpoints" --display table \
--query count --query p95:span.duration \
--group-by transaction --sort -count --limit 10
```

### Common Mistakes

- **Wrong issue ID format**: Use `PROJECT-123` (short ID), not the numeric ID `123456789`. The short ID includes the project prefix.
Expand Down
4 changes: 2 additions & 2 deletions plugins/sentry-cli/skills/sentry-cli/references/dashboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ sentry dashboard widget add 'Frontend Performance' "Error Count" --display big_n
Add a widget to a dashboard

**Flags:**
- `-d, --display <value> - Display type (line, bar, table, big_number, ...)`
- `-d, --display <value> - Display type (big_number, line, area, bar, table, stacked_area, top_n, text, categorical_bar, details, wheel, rage_and_dead_clicks, server_tree, agents_traces_table)`
- `--dataset <value> - Widget dataset (default: spans)`
- `-q, --query <value>... - Aggregate expression (e.g. count, p95:span.duration)`
- `-w, --where <value> - Search conditions filter (e.g. is:unresolved)`
Expand All @@ -106,7 +106,7 @@ Edit a widget in a dashboard
- `-i, --index <value> - Widget index (0-based)`
- `-t, --title <value> - Widget title to match`
- `--new-title <value> - New widget title`
- `-d, --display <value> - Display type (line, bar, table, big_number, ...)`
- `-d, --display <value> - Display type (big_number, line, area, bar, table, stacked_area, top_n, text, categorical_bar, details, wheel, rage_and_dead_clicks, server_tree, agents_traces_table)`
- `--dataset <value> - Widget dataset (default: spans)`
- `-q, --query <value>... - Aggregate expression (e.g. count, p95:span.duration)`
- `-w, --where <value> - Search conditions filter (e.g. is:unresolved)`
Expand Down
3 changes: 2 additions & 1 deletion src/commands/dashboard/widget/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ export const addCommand = buildCommand({
display: {
kind: "parsed",
parse: String,
brief: "Display type (line, bar, table, big_number, ...)",
brief:
"Display type (big_number, line, area, bar, table, stacked_area, top_n, text, categorical_bar, details, wheel, rage_and_dead_clicks, server_tree, agents_traces_table)",
},
dataset: {
kind: "parsed",
Expand Down
3 changes: 2 additions & 1 deletion src/commands/dashboard/widget/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ export const editCommand = buildCommand({
display: {
kind: "parsed",
parse: String,
brief: "Display type (line, bar, table, big_number, ...)",
brief:
"Display type (big_number, line, area, bar, table, stacked_area, top_n, text, categorical_bar, details, wheel, rage_and_dead_clicks, server_tree, agents_traces_table)",
optional: true,
},
dataset: {
Expand Down
27 changes: 27 additions & 0 deletions src/commands/dashboard/widget/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,33 @@ export const widgetRoute = buildRouteMap({
brief: "Manage dashboard widgets",
fullDescription:
"Add, edit, or delete widgets in a Sentry dashboard.\n\n" +
"Dashboards use a 6-column grid. Widget widths should sum to 6 per row.\n\n" +
"Display types (width × height):\n" +
" common: big_number (2×1), line (3×2), area (3×2), bar (3×2), table (6×2)\n" +
" specialized: stacked_area (3×2), top_n (3×2), categorical_bar (3×2), text (3×2)\n" +
" internal: details (3×2), wheel (3×2), rage_and_dead_clicks (3×2),\n" +
" server_tree (3×2), agents_traces_table (3×2)\n\n" +
"Datasets: spans (default), discover, issue, error-events, transaction-like,\n" +
" metrics, logs, tracemetrics, preprod-app-size\n\n" +
"Aggregates (spans): count, count_unique, sum, avg, percentile, p50, p75,\n" +
" p90, p95, p99, p100, eps, epm, any, min, max\n" +
"Aggregates (discover adds): failure_count, failure_rate, apdex,\n" +
" count_miserable, user_misery, count_web_vitals, count_if, count_at_least,\n" +
" last_seen, latest_event, var, stddev, cov, corr, performance_score,\n" +
" opportunity_score, count_scores\n" +
"Aliases: spm → epm, sps → eps, tpm → epm, tps → eps\n\n" +
"Row-filling examples:\n" +
" # 3 KPIs (2+2+2 = 6)\n" +
' sentry dashboard widget add <d> "Error Count" --display big_number --query count\n' +
' sentry dashboard widget add <d> "P95" --display big_number --query p95:span.duration\n' +
' sentry dashboard widget add <d> "Throughput" --display big_number --query epm\n\n' +
" # 2 charts (3+3 = 6)\n" +
' sentry dashboard widget add <d> "Errors" --display line --query count\n' +
' sentry dashboard widget add <d> "Latency" --display line --query p95:span.duration\n\n' +
" # Full-width table (6 = 6)\n" +
' sentry dashboard widget add <d> "Top Endpoints" --display table \\\n' +
" --query count --query p95:span.duration --group-by transaction \\\n" +
" --sort -count --limit 10\n\n" +
"Commands:\n" +
" add Add a widget to a dashboard\n" +
" edit Edit a widget in a dashboard\n" +
Expand Down
Loading