|
| 1 | +--- |
| 2 | +title: dashboard |
| 3 | +description: Dashboard commands for the Sentry CLI |
| 4 | +--- |
| 5 | + |
| 6 | +View and manage dashboards in your Sentry organization. |
| 7 | + |
| 8 | +## Commands |
| 9 | + |
| 10 | +### `sentry dashboard list` |
| 11 | + |
| 12 | +List dashboards in an organization. |
| 13 | + |
| 14 | +```bash |
| 15 | +# Auto-detect org from config |
| 16 | +sentry dashboard list |
| 17 | + |
| 18 | +# Explicit org |
| 19 | +sentry dashboard list my-org/ |
| 20 | + |
| 21 | +# Explicit org and project |
| 22 | +sentry dashboard list my-org/my-project |
| 23 | +``` |
| 24 | + |
| 25 | +**Arguments:** |
| 26 | + |
| 27 | +| Argument | Description | |
| 28 | +|----------|-------------| |
| 29 | +| `<org>/` | Organization slug (optional — auto-detected from config if omitted) | |
| 30 | +| `<org>/<project>` | Organization and project to scope the dashboard list | |
| 31 | + |
| 32 | +**Options:** |
| 33 | + |
| 34 | +| Option | Description | |
| 35 | +|--------|-------------| |
| 36 | +| `-w, --web` | Open in browser | |
| 37 | +| `-n, --limit <n>` | Maximum number of dashboards to list (default: 30) | |
| 38 | +| `-f, --fresh` | Bypass cache and fetch fresh data | |
| 39 | +| `--json` | Output as JSON | |
| 40 | + |
| 41 | +**Examples:** |
| 42 | + |
| 43 | +```bash |
| 44 | +sentry dashboard list |
| 45 | +``` |
| 46 | + |
| 47 | +``` |
| 48 | +ID TITLE WIDGETS CREATED |
| 49 | +12345 General 4 2024-01-15 |
| 50 | +12346 Frontend Performance 6 2024-02-20 |
| 51 | +12347 Backend Errors 3 2024-03-10 |
| 52 | +``` |
| 53 | + |
| 54 | +**Open dashboard list in browser:** |
| 55 | + |
| 56 | +```bash |
| 57 | +sentry dashboard list -w |
| 58 | +``` |
| 59 | + |
| 60 | +### `sentry dashboard view` |
| 61 | + |
| 62 | +View details of a specific dashboard, including its widgets. |
| 63 | + |
| 64 | +```bash |
| 65 | +# By numeric ID |
| 66 | +sentry dashboard view <id> |
| 67 | + |
| 68 | +# By title |
| 69 | +sentry dashboard view '<title>' |
| 70 | + |
| 71 | +# With explicit org |
| 72 | +sentry dashboard view <org>/ <id> |
| 73 | +``` |
| 74 | + |
| 75 | +**Arguments:** |
| 76 | + |
| 77 | +| Argument | Description | |
| 78 | +|----------|-------------| |
| 79 | +| `<id>` or `<title>` | Dashboard ID (numeric) or title (case-insensitive) | |
| 80 | +| `<org>/` | Organization slug (optional) | |
| 81 | + |
| 82 | +**Options:** |
| 83 | + |
| 84 | +| Option | Description | |
| 85 | +|--------|-------------| |
| 86 | +| `-w, --web` | Open in browser | |
| 87 | +| `-f, --fresh` | Bypass cache and fetch fresh data | |
| 88 | +| `--json` | Output as JSON | |
| 89 | + |
| 90 | +**Examples:** |
| 91 | + |
| 92 | +```bash |
| 93 | +sentry dashboard view 12345 |
| 94 | +``` |
| 95 | + |
| 96 | +``` |
| 97 | +Dashboard: Frontend Performance (ID: 12345) |
| 98 | +URL: https://my-org.sentry.io/dashboard/12345/ |
| 99 | +
|
| 100 | +Widgets: |
| 101 | + #0 Error Count big_number count() |
| 102 | + #1 Errors Over Time line count() |
| 103 | + #2 Errors by Browser bar count() group by browser.name |
| 104 | + #3 Top Endpoints table count(), p95(span.duration) group by transaction |
| 105 | +``` |
| 106 | + |
| 107 | +**View by title:** |
| 108 | + |
| 109 | +```bash |
| 110 | +sentry dashboard view 'Frontend Performance' |
| 111 | +``` |
| 112 | + |
| 113 | +**Open in browser:** |
| 114 | + |
| 115 | +```bash |
| 116 | +sentry dashboard view 12345 -w |
| 117 | +``` |
| 118 | + |
| 119 | +### `sentry dashboard create` |
| 120 | + |
| 121 | +Create a new dashboard. |
| 122 | + |
| 123 | +```bash |
| 124 | +# Auto-detect org |
| 125 | +sentry dashboard create '<title>' |
| 126 | + |
| 127 | +# Explicit org |
| 128 | +sentry dashboard create <org>/ '<title>' |
| 129 | + |
| 130 | +# Explicit org and project |
| 131 | +sentry dashboard create <org>/<project> '<title>' |
| 132 | +``` |
| 133 | + |
| 134 | +**Arguments:** |
| 135 | + |
| 136 | +| Argument | Description | |
| 137 | +|----------|-------------| |
| 138 | +| `<title>` | Dashboard title | |
| 139 | +| `<org>/` or `<org>/<project>` | Organization and optional project (auto-detected if omitted) | |
| 140 | + |
| 141 | +**Examples:** |
| 142 | + |
| 143 | +```bash |
| 144 | +sentry dashboard create 'Frontend Performance' |
| 145 | +``` |
| 146 | + |
| 147 | +``` |
| 148 | +Created dashboard: Frontend Performance (ID: 12348) |
| 149 | +URL: https://my-org.sentry.io/dashboard/12348/ |
| 150 | +``` |
| 151 | + |
| 152 | +**Add widgets after creation:** |
| 153 | + |
| 154 | +```bash |
| 155 | +sentry dashboard widget add 'Frontend Performance' "Error Count" --display big_number --query count |
| 156 | +``` |
| 157 | + |
| 158 | +### `sentry dashboard widget add` |
| 159 | + |
| 160 | +Add a widget to an existing dashboard. |
| 161 | + |
| 162 | +```bash |
| 163 | +sentry dashboard widget add <dashboard> '<widget-title>' --display <type> [options] |
| 164 | +``` |
| 165 | + |
| 166 | +**Arguments:** |
| 167 | + |
| 168 | +| Argument | Description | |
| 169 | +|----------|-------------| |
| 170 | +| `<dashboard>` | Dashboard ID (numeric) or title | |
| 171 | +| `<widget-title>` | Title for the new widget | |
| 172 | +| `<org>/` | Organization slug (optional, prepend before dashboard) | |
| 173 | + |
| 174 | +**Options:** |
| 175 | + |
| 176 | +| Option | Description | |
| 177 | +|--------|-------------| |
| 178 | +| `-d, --display <type>` | Display type: `line`, `bar`, `table`, `big_number`, `area`, `top_n` (required) | |
| 179 | +| `--dataset <dataset>` | Widget dataset (default: `spans`). Also accepts `discover` | |
| 180 | +| `-q, --query <expr>` | Aggregate expression (repeatable for multiple columns) | |
| 181 | +| `-w, --where <filter>` | Search conditions filter | |
| 182 | +| `-g, --group-by <col>` | Group-by column (repeatable) | |
| 183 | +| `-s, --sort <expr>` | Sort order (prefix `-` for descending) | |
| 184 | +| `-n, --limit <n>` | Result row limit | |
| 185 | +| `--json` | Output as JSON | |
| 186 | + |
| 187 | +**Query shorthand:** |
| 188 | + |
| 189 | +The `--query` flag supports shorthand for aggregate functions: |
| 190 | + |
| 191 | +| Input | Expands to | |
| 192 | +|-------|-----------| |
| 193 | +| `count` | `count()` | |
| 194 | +| `p95:span.duration` | `p95(span.duration)` | |
| 195 | +| `avg:span.duration` | `avg(span.duration)` | |
| 196 | +| `count()` | `count()` (passthrough) | |
| 197 | + |
| 198 | +**Sort shorthand:** |
| 199 | + |
| 200 | +| Input | Meaning | |
| 201 | +|-------|---------| |
| 202 | +| `count` | Sort by `count()` ascending | |
| 203 | +| `-count` | Sort by `count()` descending | |
| 204 | + |
| 205 | +**Examples:** |
| 206 | + |
| 207 | +```bash |
| 208 | +# Simple counter widget |
| 209 | +sentry dashboard widget add 'My Dashboard' "Error Count" \ |
| 210 | + --display big_number --query count |
| 211 | +``` |
| 212 | + |
| 213 | +```bash |
| 214 | +# Line chart with group-by |
| 215 | +sentry dashboard widget add 'My Dashboard' "Errors by Browser" \ |
| 216 | + --display line --query count --group-by browser.name |
| 217 | +``` |
| 218 | + |
| 219 | +```bash |
| 220 | +# Table with multiple aggregates, sorted descending |
| 221 | +sentry dashboard widget add 'My Dashboard' "Top Endpoints" \ |
| 222 | + --display table \ |
| 223 | + --query count --query p95:span.duration \ |
| 224 | + --group-by transaction \ |
| 225 | + --sort -count --limit 10 |
| 226 | +``` |
| 227 | + |
| 228 | +```bash |
| 229 | +# With search filter |
| 230 | +sentry dashboard widget add 'My Dashboard' "Slow Requests" \ |
| 231 | + --display bar --query p95:span.duration \ |
| 232 | + --where "span.op:http.client" \ |
| 233 | + --group-by span.description |
| 234 | +``` |
| 235 | + |
| 236 | +### `sentry dashboard widget edit` |
| 237 | + |
| 238 | +Edit an existing widget in a dashboard. Only provided flags are changed — omitted values are preserved. |
| 239 | + |
| 240 | +```bash |
| 241 | +# Identify widget by title |
| 242 | +sentry dashboard widget edit <dashboard> --title '<widget-title>' [options] |
| 243 | + |
| 244 | +# Identify widget by index (0-based) |
| 245 | +sentry dashboard widget edit <dashboard> --index <n> [options] |
| 246 | +``` |
| 247 | + |
| 248 | +**Arguments:** |
| 249 | + |
| 250 | +| Argument | Description | |
| 251 | +|----------|-------------| |
| 252 | +| `<dashboard>` | Dashboard ID (numeric) or title | |
| 253 | +| `<org>/` | Organization slug (optional, prepend before dashboard) | |
| 254 | + |
| 255 | +**Options:** |
| 256 | + |
| 257 | +| Option | Description | |
| 258 | +|--------|-------------| |
| 259 | +| `-i, --index <n>` | Widget index (0-based) | |
| 260 | +| `-t, --title <title>` | Match widget by title (case-insensitive) | |
| 261 | +| `--new-title <title>` | Rename the widget | |
| 262 | +| `-d, --display <type>` | Change display type | |
| 263 | +| `--dataset <dataset>` | Change widget dataset | |
| 264 | +| `-q, --query <expr>` | Replace aggregate expression(s) | |
| 265 | +| `-w, --where <filter>` | Replace search conditions | |
| 266 | +| `-g, --group-by <col>` | Replace group-by column(s) | |
| 267 | +| `-s, --sort <expr>` | Replace sort order | |
| 268 | +| `-n, --limit <n>` | Change result limit | |
| 269 | +| `--json` | Output as JSON | |
| 270 | + |
| 271 | +**Examples:** |
| 272 | + |
| 273 | +```bash |
| 274 | +# Change display type |
| 275 | +sentry dashboard widget edit 12345 --title 'Error Count' --display bar |
| 276 | +``` |
| 277 | + |
| 278 | +```bash |
| 279 | +# Rename a widget |
| 280 | +sentry dashboard widget edit 'My Dashboard' --index 0 --new-title 'Total Errors' |
| 281 | +``` |
| 282 | + |
| 283 | +```bash |
| 284 | +# Change the query |
| 285 | +sentry dashboard widget edit 12345 --title 'Error Rate' --query p95:span.duration |
| 286 | +``` |
| 287 | + |
| 288 | +### `sentry dashboard widget delete` |
| 289 | + |
| 290 | +Remove a widget from a dashboard. |
| 291 | + |
| 292 | +```bash |
| 293 | +# Delete by title |
| 294 | +sentry dashboard widget delete <dashboard> --title '<widget-title>' |
| 295 | + |
| 296 | +# Delete by index (0-based) |
| 297 | +sentry dashboard widget delete <dashboard> --index <n> |
| 298 | +``` |
| 299 | + |
| 300 | +**Arguments:** |
| 301 | + |
| 302 | +| Argument | Description | |
| 303 | +|----------|-------------| |
| 304 | +| `<dashboard>` | Dashboard ID (numeric) or title | |
| 305 | +| `<org>/` | Organization slug (optional, prepend before dashboard) | |
| 306 | + |
| 307 | +**Options:** |
| 308 | + |
| 309 | +| Option | Description | |
| 310 | +|--------|-------------| |
| 311 | +| `-i, --index <n>` | Widget index (0-based) | |
| 312 | +| `-t, --title <title>` | Match widget by title (case-insensitive) | |
| 313 | +| `--json` | Output as JSON | |
| 314 | + |
| 315 | +**Examples:** |
| 316 | + |
| 317 | +```bash |
| 318 | +# Delete by title |
| 319 | +sentry dashboard widget delete 'My Dashboard' --title 'Error Count' |
| 320 | +``` |
| 321 | + |
| 322 | +```bash |
| 323 | +# Delete by index |
| 324 | +sentry dashboard widget delete 12345 --index 2 |
| 325 | +``` |
0 commit comments