-
-
Notifications
You must be signed in to change notification settings - Fork 6
feat(event): expand 'event list' to support org-scoped Discover/Events queries #672
Copy link
Copy link
Open
Description
Background
PR #671 added sentry event list <issue-id> for issue-scoped event listing. This issue tracks expanding it to support org-wide and project-scoped event queries via the Sentry Discover/Events API.
Proposed Usage
# Org-scoped: list error events across all projects
sentry event list my-org/ --dataset errors
# Project-scoped: list events for a specific project
sentry event list my-org/my-project/ --dataset errors
# With search query
sentry event list my-org/ --dataset transactions -q "transaction:/api/users"
# Specific fields
sentry event list my-org/ --dataset spans --field id --field timestamp --field descriptionDesign Considerations
The Discover API (GET /organizations/{org}/events/) has dynamic response fields — the shape depends on which field params are requested. This differs from every other list command which has fixed table columns.
Key decisions needed:
- Default field sets per dataset — Each dataset (
errors,transactions,spans,logs) should have sensible default columns if--fieldisn't specified - Dynamic table rendering — The table formatter needs to handle arbitrary field sets
- Dataset flag —
--datasetto select which event type (errors,transactions,spans,logs,discover) --fieldflag — Repeatable flag to specify which columns to query/display- SDK type gap — The
@sentry/apiSDK's typeddatasetparameter only acceptslogs | profile_functions | spans | uptime_results. Datasets likeerrorsandtransactionsrequire rawapiRequestToRegioncalls.
Existing Infrastructure
src/lib/api/traces.ts— Already calls/events/?dataset=transactionsanddataset=spanssrc/lib/api/logs.ts— Already callsqueryExploreEventsInTableFormatwithdataset=logssrc/lib/api/dashboards.ts— Most generic usage, maps widget types to datasetssentry api organizations/{org}/events/ -F dataset=errors -F field=id— Works today as escape hatch
Implementation Plan
- Create a generic
queryEvents()function insrc/lib/api/events.tsthat wraps the Discover endpoint - Define default field sets per dataset in a config map
- Add
--datasetand--fieldflags toevent list - Detect the target mode from positional args: issue ID vs
org/vsorg/project/ - Use dynamic table columns when field sets are custom
- Handle pagination (cursor-based, same as other list commands)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Fields
Give feedbackNo fields configured for issues without a type.