Skip to content

feat(events): Add --json output to events dropped - #3432

Draft
manessaraj wants to merge 2 commits into
sarajmanes/dain-1940-events-dropped-tablefrom
sarajmanes/dain-1940-events-dropped-json
Draft

manessaraj wants to merge 2 commits into
sarajmanes/dain-1940-events-dropped-tablefrom
sarajmanes/dain-1940-events-dropped-json

Conversation

@manessaraj

Copy link
Copy Markdown

Stacked on #3431 (the human table). Adds a --json flag to events dropped for agents and automation, since the terminal table is not machine-readable.

The JSON mirrors the same sectioned structure the table shows: an array of outcomes (outcome code, human label, dropped count, share) each carrying its reason rows (reason, category, dropped count, share). Share is a raw ratio (0.1, not "10%") so agents don't parse formatted strings. Both views are built from one function, so they never diverge.

$ sentry-cli events dropped --org acme --project web --json
[
  {
    "outcome": "client_discard",
    "label": "Client Discard",
    "events": 100,
    "share": 0.1,
    "reasons": [
      {"reason": "sample_rate", "category": "error", "events": 100, "share": 0.1}
    ]
  }
]

Follows the existing per-command --json convention in the CLI (e.g. debug-files check --json); there is no global agentic auto-detection to hook into.

Refs: DAIN-1940

@linear-code

linear-code Bot commented Oct 16, 2026

Copy link
Copy Markdown

DAIN-1940

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 12b1056

@manessaraj
manessaraj force-pushed the sarajmanes/dain-1940-events-dropped-json branch 2 times, most recently from d68c937 to b296f27 Compare October 16, 2026 18:09
@manessaraj
manessaraj force-pushed the sarajmanes/dain-1940-events-dropped-json branch from b296f27 to 12b1056 Compare October 16, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant