You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 16, 2026. It is now read-only.
Events endpoint: missing metricsEnhanced dataset and meta.units in response type #71
The queryExploreEventsInTableFormat SDK function wraps GET /api/0/organizations/{org}/events/, but its OpenAPI spec has two gaps that prevent the Sentry CLI from using it for the sentry explore command. The CLI currently drops down to raw HTTP via apiRequestToRegion() in src/lib/api/discover.ts to work around both issues.
The Sentry backend also accepts metricsEnhanced (used by the Explore Metrics UI for tracemetrics queries — sum(value, metric_name, metric_type, unit) format). The CLI maps --dataset metrics to metricsEnhanced at the API level.
Passing dataset: "metricsEnhanced" to the SDK function is a type error, so the CLI can't use the SDK for metrics queries.
replays may also be missing — the CLI uses it for --dataset replays on the same endpoint.
Gap 2: meta.units missing from response type
The actual API response includes meta.units — a Record<string, string | null> mapping field names to their unit (e.g., "millisecond", "none"). The SDK's OrganizationEventsResponseDict type does not include it:
The CLI uses meta.units for dashboard widget formatting and metric metadata extraction. Without it in the SDK type, callers need manual type augmentation or a separate Zod schema.
Impact
The CLI's src/lib/api/discover.ts uses raw apiRequestToRegion() with a hand-written EventsTableResponseSchema instead of the SDK's queryExploreEventsInTableFormat. This is inconsistent with other API modules (logs.ts, issues.ts, events.ts, etc.) that already use the SDK.
Similarly, src/lib/api/dashboards.ts uses raw requests for the same endpoint for widget table/timeseries queries.
Expected behavior
Add metricsEnhanced (and replays if valid) to the dataset enum for queryExploreEventsInTableFormat and queryExploreEventsInTimeseriesFormat
Add units?: { [key: string]: string | null } to the meta object in OrganizationEventsResponseDict
Resolved on getsentry/sentry master: meta.units is now in the events response schema (organization_events.py), and application metrics are queried with the public tracemetrics dataset, while metricsEnhanced is intentionally left out as a deprecated alias and replays is rejected by this endpoint (parameters.py). Both ship in @sentry/api 2.5.0.
Activity
sentry-junior commentedon Nov 14, 2026
Resolved on getsentry/sentry
master:meta.unitsis now in the events response schema (organization_events.py), and application metrics are queried with the publictracemetricsdataset, whilemetricsEnhancedis intentionally left out as a deprecated alias andreplaysis rejected by this endpoint (parameters.py). Both ship in@sentry/api2.5.0.