@sentry/junior-sentry 0.101.0 → 0.102.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -4
- package/package.json +1 -1
- package/plugin.yaml +1 -1
- package/skills/sentry/SKILL.md +6 -4
- package/skills/sentry/SOURCES.md +12 -5
- package/skills/sentry/SPEC.md +15 -13
- package/skills/sentry/references/cli-commands.md +47 -5
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @sentry/junior-sentry
|
|
2
2
|
|
|
3
|
-
`@sentry/junior-sentry` adds
|
|
3
|
+
`@sentry/junior-sentry` adds Sentry investigation workflows and explicitly requested alert/monitor creation to Junior via per-user OAuth.
|
|
4
4
|
|
|
5
5
|
Install it alongside `@sentry/junior`:
|
|
6
6
|
|
|
@@ -18,15 +18,16 @@ export const plugins = defineJuniorPlugins(["@sentry/junior-sentry"]);
|
|
|
18
18
|
|
|
19
19
|
## Sentry CLI Surface
|
|
20
20
|
|
|
21
|
-
The plugin installs the npm `sentry` package as a runtime dependency and injects the current user's OAuth token as `SENTRY_AUTH_TOKEN` for Sentry skill commands.
|
|
21
|
+
The plugin installs the npm `sentry` package as a runtime dependency and injects the current user's OAuth token as `SENTRY_AUTH_TOKEN` for Sentry skill commands. The OAuth grant includes `alerts:write`; existing connections must reconnect after upgrading to grant it.
|
|
22
22
|
|
|
23
|
-
As of 2026-
|
|
23
|
+
As of 2026-07-13, `sentry@latest` is `0.38.0`. The verified command groups used by the bundled skill are:
|
|
24
24
|
|
|
25
25
|
- `sentry issue list|events|explain|plan|view`
|
|
26
26
|
- `sentry org list|view`
|
|
27
27
|
- `sentry log list|view`
|
|
28
28
|
- `sentry trace list|view|logs`
|
|
29
|
-
- `sentry
|
|
29
|
+
- `sentry alert metrics list|view|create|edit|delete`
|
|
30
|
+
- `sentry api <endpoint>` as a fallback when no first-class command covers the request
|
|
30
31
|
|
|
31
32
|
The skill must verify live `sentry --help` output before declaring a Sentry data surface unavailable. Prefer singular command groups such as `sentry org list`; do not use stale forms such as `sentry organizations list`.
|
|
32
33
|
|
package/package.json
CHANGED
package/plugin.yaml
CHANGED
|
@@ -23,7 +23,7 @@ oauth:
|
|
|
23
23
|
client-secret-env: SENTRY_CLIENT_SECRET
|
|
24
24
|
authorize-endpoint: https://sentry.io/oauth/authorize/
|
|
25
25
|
token-endpoint: https://sentry.io/oauth/token/
|
|
26
|
-
scope: "event:read org:read project:read team:read"
|
|
26
|
+
scope: "alerts:write event:read org:read project:read team:read"
|
|
27
27
|
|
|
28
28
|
runtime-dependencies:
|
|
29
29
|
- type: npm
|
package/skills/sentry/SKILL.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sentry
|
|
3
|
-
description: Query live Sentry telemetry
|
|
3
|
+
description: Query live Sentry telemetry, create explicitly requested Sentry alerts and monitors, and generate Sentry deep links. Use when users ask to investigate Sentry issues, events, logs, traces, organizations, projects, replays, product feature usage, Sentry's own product telemetry, authenticated Sentry API data, or to create alerting. Do not use it for repository/source-code/PR tasks, even when the topic concerns Sentry products.
|
|
4
4
|
allowed-tools: bash
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ Before declaring a Sentry data surface unavailable, verify the current CLI help:
|
|
|
18
18
|
|
|
19
19
|
1. Confirm operation and target:
|
|
20
20
|
|
|
21
|
-
- Determine operation: issue, event, log, trace, org, project, replay/deep-link, Sentry product feature usage, or API query.
|
|
21
|
+
- Determine operation: issue, event, log, trace, org, project, replay/deep-link, Sentry product feature usage, alert/monitor creation, or API query.
|
|
22
22
|
- Resolve org from channel config: `jr-rpc config get sentry.org`
|
|
23
23
|
- Resolve project from channel config: `jr-rpc config get sentry.project` (optional — many queries span multiple projects).
|
|
24
24
|
- If org is missing and needed, ask the user.
|
|
@@ -31,7 +31,9 @@ Before declaring a Sentry data surface unavailable, verify the current CLI help:
|
|
|
31
31
|
- Read [references/cli-commands.md](references/cli-commands.md) when choosing command shapes, target formats, flags, API fallback, or troubleshooting behavior.
|
|
32
32
|
- Read [references/sandbox-runtime.md](references/sandbox-runtime.md) before relying on sandbox credentials.
|
|
33
33
|
- Prefer `--json` when parsing or summarizing results.
|
|
34
|
-
- If no high-level CLI command covers the
|
|
34
|
+
- If no high-level CLI command covers the request, use `sentry api <endpoint>` before claiming the workflow is blocked.
|
|
35
|
+
- Create alerts only when the user explicitly asks. Prefer `sentry alert metrics` for metric-alert list/view/create/edit/delete; before writing, resolve the exact target, check duplicates, run the complete command with `--dry-run`, then execute once and report the created rule URL.
|
|
36
|
+
- Use `sentry api` only when live CLI help confirms the first-class command cannot express the requested alert behavior, such as dynamic anomaly detection.
|
|
35
37
|
- If a Sentry API call returns `401`, or clearly says the token is invalid, expired, revoked, or unauthorized, rerun the real Sentry command once and let the runtime trigger a reconnect flow when needed.
|
|
36
38
|
- If a Sentry API call explicitly says `missing scope`, `missing scopes`, or `insufficient scope`, rerun the real Sentry command once and let the runtime trigger a reconnect flow when needed.
|
|
37
39
|
- If a Sentry API call returns a generic `403`, `permission denied`, or otherwise indicates missing org/project access without naming missing scopes, stop and tell the user the current Sentry connection could not access the requested Sentry data.
|
|
@@ -49,7 +51,7 @@ Before declaring a Sentry data surface unavailable, verify the current CLI help:
|
|
|
49
51
|
|
|
50
52
|
## Guardrails
|
|
51
53
|
|
|
52
|
-
-
|
|
54
|
+
- Default to read-only operations. Only create, edit, or delete alerting resources when the user explicitly requests that exact action and a documented first-class CLI command supports it. Use API fallback only for explicitly requested alert behavior that live CLI help confirms is unsupported.
|
|
53
55
|
- Avoid speculative Sentry CLI subcommands. Use bundled references plus live `sentry --help` output to verify current commands.
|
|
54
56
|
- Do not print credential values.
|
|
55
57
|
- If org is missing and needed, ask the user.
|
package/skills/sentry/SOURCES.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Sentry Skill Sources
|
|
2
2
|
|
|
3
|
-
Last updated: 2026-
|
|
3
|
+
Last updated: 2026-07-13
|
|
4
4
|
|
|
5
5
|
## Source inventory
|
|
6
6
|
|
|
@@ -13,10 +13,13 @@ Last updated: 2026-06-18
|
|
|
13
13
|
| `https://cli.sentry.dev/commands/trace/` | canonical | high | Current `sentry trace list`, `view`, and `logs` commands. | Verify live help when runtime CLI differs. |
|
|
14
14
|
| `https://cli.sentry.dev/commands/api/` | canonical | high | Authenticated `sentry api <endpoint>` fallback and request flags. | Use read-only requests unless the user asks for mutation. |
|
|
15
15
|
| `https://cli.sentry.dev/configuration/` | canonical | high | `SENTRY_AUTH_TOKEN`, JSON/global flags, cache controls, and runtime configuration behavior. | Junior injects credentials; do not persist or print tokens. |
|
|
16
|
-
| `pnpm view sentry version dist-tags description bin repository` | canonical | high | Confirmed npm package `sentry` latest is `0.
|
|
17
|
-
| `pnpm dlx sentry@latest --help` and subcommand help | canonical | high | Confirmed
|
|
16
|
+
| `pnpm view sentry version dist-tags description bin repository` | canonical | high | Confirmed npm package `sentry` latest is `0.38.0` and exposes the `sentry` binary. | Package metadata only; command behavior still comes from help/docs. |
|
|
17
|
+
| `pnpm dlx sentry@latest --help` and subcommand help | canonical | high | Confirmed `alert metrics list|view|create|edit|delete`, including triggers and dry-run, plus the existing investigation commands. | Re-run when updating for a newer CLI. |
|
|
18
18
|
| `packages/junior-sentry/plugin.yaml` | canonical | high | Confirms runtime dependency is the npm `sentry` package and auth token env is `SENTRY_AUTH_TOKEN`. | Local repo contract. |
|
|
19
19
|
| `https://github.com/getsentry/junior/issues/615` | canonical | high | Regression report: Sentry product feature usage routed to Hex, then an explicit "use Sentry telemetry" redirect was ignored after Hex auth paused. | Use as routing evidence, not as command reference. |
|
|
20
|
+
| `https://docs.sentry.io/api/monitors/create-a-monitor-for-a-project/` | canonical | high | Current public monitor creation endpoint, payload fields, and metric monitor examples. | Alerting API may evolve; verify live docs before writes. |
|
|
21
|
+
| `https://docs.sentry.io/api/monitors/create-an-alert-for-an-organization/` | canonical | high | Current public alert workflow endpoint, connection fields, conditions, and actions. | Resolve integration and target IDs; never guess action identifiers. |
|
|
22
|
+
| `getsentry/sentry` workflow engine endpoint and frontend form sources | canonical | high | Confirms `alerts:write`, `detectors`/`workflows` paths, dynamic anomaly payload shape, and legacy alert-rule deprecation. | Source-backed implementation detail; public API docs remain the user-facing contract. |
|
|
20
23
|
|
|
21
24
|
## Decisions
|
|
22
25
|
|
|
@@ -29,12 +32,15 @@ Last updated: 2026-06-18
|
|
|
29
32
|
| Treat Sentry product feature usage and explicit Sentry telemetry redirects as Sentry skill triggers. | adopted | Issue 615 showed the previous trigger language under-specified product-introspection queries and let Hex win. |
|
|
30
33
|
| Preserve stale plural subcommands as recommended forms. | rejected | `organizations list` was the root failure; aliases should not be taught as canonical command shapes. |
|
|
31
34
|
| Create a broad new troubleshooting reference. | deferred | Current failure modes fit in the focused CLI reference without crowding `SKILL.md`. |
|
|
35
|
+
| Permit explicitly requested alert/monitor writes only. | adopted | `alerts:write` is intentionally narrow; unrelated Sentry mutations remain out of scope. |
|
|
36
|
+
| Prefer first-class `sentry alert metrics` commands. | adopted | CLI `0.38.0` supports list, view, create, edit, delete, triggers, and dry-run. |
|
|
37
|
+
| Keep API fallback for dynamic anomaly detection. | adopted | The current CLI create flags expose threshold triggers but no dynamic/anomaly configuration. |
|
|
32
38
|
|
|
33
39
|
## Coverage matrix
|
|
34
40
|
|
|
35
41
|
| Dimension | Coverage status | Evidence |
|
|
36
42
|
| ---------------------------------- | --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
-
| API surface and behavior contracts | complete | `cli-commands.md` covers issue, org, log, trace, and API
|
|
43
|
+
| API surface and behavior contracts | complete | `cli-commands.md` covers issue, org, log, trace, first-class metric-alert commands, and API fallback plus live help verification. |
|
|
38
44
|
| Config/runtime options | complete | `sandbox-runtime.md`, `plugin.yaml`, and CLI configuration docs cover injected auth and runtime package installation. |
|
|
39
45
|
| Common use cases | complete | `cli-commands.md` maps org listing, issue search/view/events, logs, traces, trace logs, and API fallback. |
|
|
40
46
|
| Product telemetry routing | documented | `SKILL.md` and `SPEC.md` cover Sentry product feature usage and explicit "Sentry telemetry" redirects after an unrelated auth pause. A dedicated eval should wait for the eval harness boundary cleanup. |
|
|
@@ -43,9 +49,10 @@ Last updated: 2026-06-18
|
|
|
43
49
|
|
|
44
50
|
## Open gaps
|
|
45
51
|
|
|
46
|
-
- Review the Sentry CLI docs and rerun `pnpm dlx sentry@latest --help` when the plugin pins or upgrades beyond npm `sentry@0.
|
|
52
|
+
- Review the Sentry CLI docs and rerun `pnpm dlx sentry@latest --help` when the plugin pins or upgrades beyond npm `sentry@0.38.0`.
|
|
47
53
|
|
|
48
54
|
## Changelog
|
|
49
55
|
|
|
56
|
+
- 2026-07-13: Added CLI-first `sentry alert metrics` guidance, explicit-write and duplicate safeguards, API fallback for unsupported anomaly configuration, and `alerts:write` scope behavior.
|
|
50
57
|
- 2026-06-18: Expanded trigger language for Sentry product telemetry and feature usage, and recorded issue 615 routing evidence.
|
|
51
58
|
- 2026-04-30: Reconciled skill guidance with Sentry CLI `0.30.0`, replaced stale plural command forms, added live-help verification, expanded log/trace/API guidance, updated eval smoke artifacts, and added an org-list command-selection eval.
|
package/skills/sentry/SPEC.md
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Intent
|
|
4
4
|
|
|
5
|
-
The Sentry skill helps agents investigate live Sentry telemetry through the Sentry CLI using per-user credentials injected by Junior.
|
|
6
|
-
It should produce useful
|
|
5
|
+
The Sentry skill helps agents investigate live Sentry telemetry and create explicitly requested alerts and monitors through the Sentry CLI using per-user credentials injected by Junior.
|
|
6
|
+
It should produce useful investigation results, safe alerting mutations, or Sentry web links without exposing credentials.
|
|
7
7
|
|
|
8
8
|
## Scope
|
|
9
9
|
|
|
@@ -11,37 +11,39 @@ In scope:
|
|
|
11
11
|
|
|
12
12
|
- Listing and viewing Sentry issues, issue events, logs, traces, organizations, and related read-only data.
|
|
13
13
|
- Investigating Sentry's own product telemetry and product feature usage through Sentry CLI/API data surfaces.
|
|
14
|
-
- Using `sentry api <endpoint>` for authenticated
|
|
14
|
+
- Using `sentry api <endpoint>` for authenticated requests when no high-level command exists.
|
|
15
|
+
- Creating explicitly requested metric alerts through `sentry alert metrics` after duplicate checks and dry-run validation, with API fallback only for unsupported alert behavior.
|
|
15
16
|
- Generating Sentry deep links for user-scoped or entity-specific views.
|
|
16
17
|
- Diagnosing auth, scope, and access failures without guessing missing scopes.
|
|
17
18
|
|
|
18
19
|
Out of scope:
|
|
19
20
|
|
|
20
21
|
- Repository, code search, commit, branch, and pull-request work.
|
|
21
|
-
- Mutating Sentry data
|
|
22
|
+
- Mutating Sentry data outside explicitly requested alert or monitor operations.
|
|
22
23
|
- Persisting, printing, or transforming Sentry credentials.
|
|
23
24
|
|
|
24
25
|
## Users And Trigger Context
|
|
25
26
|
|
|
26
27
|
- Primary users: Junior users asking Slack or harness agents to investigate Sentry data.
|
|
27
|
-
- Common user requests: "list my Sentry issues", "show error logs", "inspect this trace", "which orgs can I access", "open the issue in Sentry", "use Sentry telemetry", and "
|
|
28
|
+
- Common user requests: "list my Sentry issues", "show error logs", "inspect this trace", "which orgs can I access", "open the issue in Sentry", "use Sentry telemetry", "create a metric alert", and "notify this channel when this monitor fires".
|
|
28
29
|
- Should not trigger for: source-code tasks, GitHub PRs, repository searches, or generic questions about Sentry SDK implementation.
|
|
29
30
|
|
|
30
31
|
## Runtime Contract
|
|
31
32
|
|
|
32
33
|
- Required first actions: classify the Sentry operation, resolve configured org/project when needed, and verify current CLI help before blocking on an unknown command.
|
|
33
|
-
- Required outputs: concise findings, relevant Sentry URLs or deep links, and clear access/auth failure messages.
|
|
34
|
-
- Non-negotiable constraints: do not print credentials;
|
|
34
|
+
- Required outputs: concise findings, relevant Sentry URLs or deep links, created alerting resource URLs, and clear access/auth failure messages.
|
|
35
|
+
- Non-negotiable constraints: do not print credentials; default to read-only commands; only perform explicitly requested alerting mutations; check duplicates and dry-run before writing; use canonical current CLI command groups; use `sentry api` before claiming a surface is unavailable.
|
|
35
36
|
- Expected bundled files loaded at runtime: `references/cli-commands.md`, `references/deep-link-patterns.md`, and `references/sandbox-runtime.md`.
|
|
36
37
|
|
|
37
38
|
## Current CLI Data
|
|
38
39
|
|
|
39
|
-
- Verified date: 2026-
|
|
40
|
-
- Verified npm package: `sentry@0.
|
|
40
|
+
- Verified date: 2026-07-13.
|
|
41
|
+
- Verified npm package: `sentry@0.38.0`, installed from the plugin `runtime-dependencies` entry.
|
|
41
42
|
- Auth model: Junior injects `SENTRY_AUTH_TOKEN` for authenticated Sentry commands during the requesting user's turn.
|
|
42
|
-
- Canonical command groups: `sentry issue`, `sentry org`, `sentry log`, `sentry trace`, and `sentry api`.
|
|
43
|
+
- Canonical command groups: `sentry issue`, `sentry org`, `sentry log`, `sentry trace`, `sentry alert metrics`, and `sentry api`.
|
|
43
44
|
- Required migration rule: prefer singular command groups such as `sentry org list`; do not teach stale plural command forms such as `sentry organizations list`.
|
|
44
|
-
- Required fallback rule: use `sentry api <endpoint>`
|
|
45
|
+
- Required fallback rule: use `sentry api <endpoint>` when no high-level CLI command covers the requested surface.
|
|
46
|
+
- Alerting write rule: prefer `sentry alert metrics`; use the API fallback only when live CLI help confirms the requested behavior is unsupported.
|
|
45
47
|
|
|
46
48
|
## Source And Evidence Model
|
|
47
49
|
|
|
@@ -77,9 +79,9 @@ Data that must not be stored:
|
|
|
77
79
|
## Evaluation
|
|
78
80
|
|
|
79
81
|
- Lightweight validation: run skill validation and grep for stale command forms after CLI updates.
|
|
80
|
-
- Deeper evaluation: add Slack/harness evals for org listing, issue search, log search, trace lookup, API fallback, and
|
|
82
|
+
- Deeper evaluation: add Slack/harness evals for org listing, issue search, log search, trace lookup, API fallback, auth recovery, explicit alert creation, duplicate prevention, and refusal of unrelated mutations.
|
|
81
83
|
- Holdout examples: requests that mention "organizations list", "orgs", "logs for this trace", and "use the API".
|
|
82
|
-
- Acceptance gates: command guidance matches latest CLI help, stale plural forms are not canonical, read-only fallback is available, and credential handling remains private.
|
|
84
|
+
- Acceptance gates: command guidance matches latest CLI help, stale plural forms are not canonical, read-only fallback is available, alerting writes require explicit intent plus duplicate and dry-run checks, unrelated mutations remain blocked, and credential handling remains private.
|
|
83
85
|
|
|
84
86
|
## Known Limitations
|
|
85
87
|
|
|
@@ -11,7 +11,7 @@ The npm `sentry` package is intentionally installed at runtime from the plugin m
|
|
|
11
11
|
2. Do not use stale plural subcommands such as `sentry organizations list`.
|
|
12
12
|
3. If a command errors as unknown, run `sentry --help` and the nearest subcommand help before declaring the surface unavailable.
|
|
13
13
|
4. Prefer `--json` and, when useful, `--fields` for structured parsing.
|
|
14
|
-
5. Use `sentry api <endpoint>` for authenticated
|
|
14
|
+
5. Use `sentry api <endpoint>` for authenticated API calls when a high-level command does not cover the request. Default to `GET`; only perform documented alert or monitor mutations when explicitly requested.
|
|
15
15
|
|
|
16
16
|
## Issue commands
|
|
17
17
|
|
|
@@ -78,16 +78,53 @@ sentry trace list [ORG/PROJECT|PROJECT] [--query QUERY] [--period PERIOD] [--sor
|
|
|
78
78
|
Use `sentry trace view [ORG/PROJECT/]TRACE_ID` for trace details.
|
|
79
79
|
Use `sentry trace logs [ORG/]TRACE_ID` when the user asks for logs associated with a trace.
|
|
80
80
|
|
|
81
|
+
## Metric alert commands
|
|
82
|
+
|
|
83
|
+
Use the first-class CLI surface for metric alerts:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
sentry alert metrics list ORG/ [--query NAME] [--fresh] [--json]
|
|
87
|
+
sentry alert metrics view ORG/RULE_ID_OR_NAME [--json]
|
|
88
|
+
sentry alert metrics create ORG --name NAME --query QUERY --aggregate AGGREGATE \
|
|
89
|
+
--dataset DATASET --time-window MINUTES --trigger TRIGGER_JSON \
|
|
90
|
+
[--project PROJECT]... [--environment ENVIRONMENT] [--owner OWNER] [--dry-run] [--json]
|
|
91
|
+
sentry alert metrics edit ORG/RULE_ID_OR_NAME [OPTIONS]
|
|
92
|
+
sentry alert metrics delete ORG/RULE_ID_OR_NAME [--dry-run]
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Before creating a rule:
|
|
96
|
+
|
|
97
|
+
- Run `sentry alert metrics create --help` and treat live help as authoritative.
|
|
98
|
+
- Resolve the exact org, project, owner, integration, and notification target IDs.
|
|
99
|
+
- List existing rules and stop on a likely duplicate unless the user explicitly asks for another.
|
|
100
|
+
- Run the complete create command with `--dry-run`, then execute it once without `--dry-run`.
|
|
101
|
+
- Pass each trigger as JSON with `--trigger`; do not guess action IDs or target identifiers.
|
|
102
|
+
|
|
103
|
+
Example static error-volume rule:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
sentry alert metrics create ORG \
|
|
107
|
+
--name 'Non-Zod error spike' \
|
|
108
|
+
--query '!error.type:ZodError' \
|
|
109
|
+
--aggregate 'count()' \
|
|
110
|
+
--dataset errors \
|
|
111
|
+
--time-window 60 \
|
|
112
|
+
--project PROJECT \
|
|
113
|
+
--environment production \
|
|
114
|
+
--owner 'team:TEAM_ID' \
|
|
115
|
+
--trigger '{"alertThreshold":50,"actions":[...]}' \
|
|
116
|
+
--dry-run
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The current CLI create command exposes threshold triggers but no dynamic/anomaly detection flags. If the user explicitly needs anomaly detection, verify live CLI help first; when still unsupported, use `sentry api` with the current public monitor/alert API rather than inventing CLI flags.
|
|
120
|
+
|
|
81
121
|
## API fallback
|
|
82
122
|
|
|
83
123
|
```bash
|
|
84
124
|
sentry api ENDPOINT [--method METHOD] [--field KEY=VALUE] [--data JSON] [--json]
|
|
85
125
|
```
|
|
86
126
|
|
|
87
|
-
|
|
88
|
-
- Use read-only `GET` requests by default.
|
|
89
|
-
- Do not use API write methods unless the user explicitly asks for a mutating Sentry action.
|
|
90
|
-
- Use `--dry-run` when verifying a complex endpoint or request body.
|
|
127
|
+
Use `sentry api` only when no first-class CLI command covers the requested operation. Default to read-only `GET` requests. For an explicitly requested alerting write, validate with `--dry-run` and verify the current API schema before executing. Do not mutate unrelated Sentry resources.
|
|
91
128
|
|
|
92
129
|
## Common flags
|
|
93
130
|
|
|
@@ -109,6 +146,8 @@ sentry api ENDPOINT [--method METHOD] [--field KEY=VALUE] [--data JSON] [--json]
|
|
|
109
146
|
| "Inspect a trace" | `sentry trace view ORG/PROJECT/TRACE_ID --json` |
|
|
110
147
|
| "Show logs for a trace" | `sentry trace logs ORG/TRACE_ID --json` |
|
|
111
148
|
| "Call an endpoint not covered by high-level commands" | `sentry api organizations/ --json` |
|
|
149
|
+
| "Create a static metric alert" | `sentry alert metrics create ... --dry-run`, then execute |
|
|
150
|
+
| "Create a dynamic anomaly alert" | Verify CLI help; use API fallback only if still unsupported |
|
|
112
151
|
|
|
113
152
|
## Troubleshooting
|
|
114
153
|
|
|
@@ -124,5 +163,8 @@ sentry api ENDPOINT [--method METHOD] [--field KEY=VALUE] [--data JSON] [--json]
|
|
|
124
163
|
| API returns `401` or invalid/expired/revoked token text | Stale or missing credential | Rerun the real command once so the runtime can trigger reconnect. |
|
|
125
164
|
| API returns explicit missing scope text | OAuth grant lacks a named scope | Rerun the real command once so the runtime can trigger reconnect. |
|
|
126
165
|
| API returns generic `403` or permission denied | Connected account lacks org/project access | Stop and tell the user the current connection cannot access the requested data. |
|
|
166
|
+
| Alert write returns an explicit missing-scope error | OAuth grant predates alert writes | Rerun once to trigger reconnect; the connection needs `alerts:write`. |
|
|
167
|
+
| Static metric alert requested | First-class CLI command is available | Use `sentry alert metrics create`; do not drop directly to `sentry api`. |
|
|
168
|
+
| Dynamic/anomaly alert flags are unavailable | CLI coverage gap | Verify live help, then use the current API fallback if needed. |
|
|
127
169
|
|
|
128
170
|
Use these command shapes during normal skill execution, but treat live CLI help as the final source when this reference and the installed CLI disagree.
|