Skip to content

feat(cli): add issue tag distributions - #1636

Merged
betegon merged 2 commits into
mainfrom
bt/cli-issue-tags
Oct 29, 2026
Merged

betegon merged 2 commits into
mainfrom
bt/cli-issue-tags

Conversation

@betegon

@betegon betegon commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Inspecting an issue tag distribution currently requires a raw API request. Add sentry issue tags <issue> <key> so agents can compare releases, servers, or browsers using the same issue IDs, URLs, and selectors as other issue commands. Recovery commands preserve the tag key and environment.

Uses the public tag-details endpoint to return up to nine top values, with an optional single environment. Human output shows shares of all retained events and the undisplayed remainder; JSON preserves the API response and nulls. Unsupported time/search/pagination flags are rejected, and tag text is sanitized before terminal rendering. Includes command/API/SDK regression coverage and generated docs and skill references.

Examples

Compare releases for an issue in production:

sentry issue tags my-org/FRONT-ABC release --environment production

Illustrative output using synthetic data:

release — top values

Total retained events: 100

VALUE               EVENTS  SHARE
2.4.0               70      70.0%
2.3.1               20      20.0%
(empty or missing)  10      10.0%

Issue: FRONT-ABC. Environment: production. Scope: retained events.

The percentages use all retained events as the denominator, including events without a release value. When the top values do not cover every event, human output also reports the undisplayed remainder.

Inspect servers for the issue selected by @latest:

sentry issue tags @latest server_name

Read a browser distribution as JSON and select the aggregate fields for an agent:

sentry issue tags my-org/FRONT-ABC browser.name --json --fields key,totalValues,topValues

@vercel

vercel Bot commented Oct 23, 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 Oct 29, 2026 11:07am UTC

Request Review

@betegon
betegon marked this pull request as ready for review October 25, 2026 20:50
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Oct 25, 2026
@betegon
betegon merged commit 256684e into main Oct 29, 2026
26 checks passed
@betegon
betegon deleted the bt/cli-issue-tags branch October 29, 2026 13:00
BYK added a commit that referenced this pull request Oct 29, 2026
Bumps `@sentry/api` from 0.423.0 to 0.425.0, the latest published
version. It changes the catalog entry and the `minimumReleaseAgeExclude`
entry in `pnpm-workspace.yaml`, plus the lockfile.

### What changes upstream

- **Pagination continuations** (sentry-api-schema#115, #116):
- `paginateUpTo` now returns a serializable `continuation`, and accepts
`resume`, so a batch can pick up inside a partly consumed page.
- `consumePage` and `CollectionPageFetcher` let a caller reuse a page it
already fetched.
- `BudgetedPageFetcher`'s second parameter is now the request budget. On
a replay it repeats the original budget.
- **New module:** `source-analysis`, which brings a new optional
`typescript` peer. The lockfile resolves it to the existing
`[email protected]`.
- Everything else is additive:
  - `types.gen.d.ts` is unchanged.
  - No exports were removed.

### Impact here

- **Nothing in this repo calls the changed helpers yet.** That covers
`paginateUpTo`, `paginateAll`, `consumePage` and `fetchPage`.
`unwrapPaginatedResult` is used in `cli/src/lib/api/alerts.ts` and
`dashboards.ts`, and its signature is unchanged. No code changes were
needed.
- **toolkit-core's own pagination** (`paginate` and `fetchAllPages` in
`toolkit-core/src/pagination.ts`) is a separate implementation and isn't
affected.
- It already resumes inside a page by writing the consumed rows into the
cursor's `is_prev` field. That keeps cursors as plain Sentry cursor
strings, which the API and older CLIs still accept.
- Moving it onto `@sentry/api`'s object-based continuation is a possible
follow-up for #1669. It would mean deciding how to serialize the
continuation for the CLI's `--cursor` and the MCP's cursor inputs, so I
left it out of this bump.

### Verification

- `pnpm install --frozen-lockfile` is clean.
- `tsc --noEmit` passes for `toolkit-core`, `mcp-core`, `mcp-server`,
`mcp-cloudflare` and `cli`. That includes the CLI's regenerated SDK,
which produces no diff.
- `toolkit-core`: 270 tests pass. `mcp-core`: 1,885 pass, 6 skipped.
- CLI unit tests: 11,760 pass. 7 fail in this sandbox:
- 6 are the file-permission tests that also fail on clean `main` here
(completions, telemetry, upgrade, code-scanner, file-changes).
- The 7th, `completions.property`, failed because the gitignored
`completion-targets.json` was stale after #1636. It passes after
`generate:completions`, and CI regenerates that file.

The lockfile needed one workaround. pnpm checks the existing lockfile
entries against `minimumReleaseAge` before it resolves anything. 0.423.0
is under the cutoff, and its exclusion is dropped in this PR, so a plain
`pnpm install` refused to run. I removed the old `@sentry/api` entries
and resolved again. The lockfile diff only swaps 0.423.0 for 0.425.0,
with the published integrity hash.

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

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3Aa6eddc0161cff61914454da9f74fcdf1 -->

--

[View Junior Session in
Sentry](https://sentry.sentry.io/explore/conversations/agent%3Aa6eddc0161cff61914454da9f74fcdf1/?project=4510944073809921)

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

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: BYK <[email protected]>
joshuawayzwright pushed a commit to joshuawayzwright/sentry-mcp that referenced this pull request Nov 16, 2026
The `sentry span view` command currently throws a `ValidationError`
(exit code 21) when a requested trace or span ID is not found. According
to the CLI's error hierarchy documentation (AGENTS.md), a valid input
that cannot be resolved should throw a `ResolutionError` (exit code 23).

This PR updates the `span view` command to correctly throw
`ResolutionError` in the following scenarios:
- When no trace is found for the given trace ID.
- When no requested span(s) are found within the trace.

This change aligns the command's error behavior with the established
error-type contract, providing more accurate exit codes and user
feedback.

<!-- SEER_FIXES_SENTRY_ISSUE -->
Fixes
[CLI-1Q4](https://sentry.sentry.io/issues/7473765728/?seerDrawer=true)
<!-- /SEER_FIXES_SENTRY_ISSUE -->

<sub>`@sentry <feedback>`: Autofix iterates on these changes</sub>
<sub>`@sentry stop iterating`: Autofix stops iterating on this run</sub>

<sub>This PR was automatically generated by Sentry. You can [adjust this
setting](https://sentry.sentry.io/settings/projects/cli/seer/) at any
time.</sub>

Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>

This branch was previously deployed

1 inactive deployment
Preview — ed65b850 Deployed Oct 29, 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants