Skip to content

docs(explore): Document repeated yAxis, interval units, and trace timestamp - #130349

Merged
BYK merged 1 commit into
masterfrom
docs/explore-timeseries-trace-params
Nov 7, 2026
Merged

BYK merged 1 commit into
masterfrom
docs/explore-timeseries-trace-params

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Three query parameters on public Explore endpoints were documented differently from what the code accepts:

  • yAxis on listOrganizationEventsTimeseries was a single string. The endpoint reads request.GET.getlist("yAxis") and returns one timeseries per aggregate, so it's now an array (repeated ?yAxis=count()&yAxis=p95(span.duration)).
  • interval (VisibilityParams.INTERVAL, used by listOrganizationEventsTimeseries and listOrganizationEventsDropped) was an integer. get_rollup_from_request parses it with parse_stats_period, which also takes a unit suffix such as 5m or 1h. It's now anyOf: [integer, string matching ^\d+[smhdw]?$], so callers that pass a number keep working.
  • timestamp on getOrganizationTrace and getOrganizationTraceMeta wasn't listed. Both endpoints pass it to update_snuba_params_with_timestamp, which accepts ISO 8601 or Unix seconds and narrows the query window. I added it as TraceParams.TIMESTAMP.

Only those four operations change in the generated schema. There's no runtime change.

The Sentry CLI needs these to move its timeseries and trace calls onto the generated @sentry/api operations (getsentry/toolkit#2073). Right now the generated types reject repeated yAxis, interval=1h and timestamp. One thing to note for SDK consumers: the generated yAxis type changes from string to string[].

Checked locally with make build-api-docs, pnpm run validate-api-examples, tests/apidocs, prek and mypy. I also ran tests/snuba/api/endpoints/test_organization_trace_meta.py and test_organization_events_timeseries.py::test_simple. Under xdist those snuba tests miss rows from shared state, but run serially they pass.

via @BYK.

--

View Session [Sentry]

…estamp

The events timeseries endpoint reads yAxis with getlist and returns one
timeseries per aggregate, but the docs typed it as a single string. Its
interval, shared with the dropped events endpoint, goes through
parse_stats_period, which accepts a unit suffix such as 5m or 1h, but the
docs typed it as an integer.

The trace and trace meta endpoints narrow their query window around an
optional timestamp parameter that the docs didn't list.

Document yAxis as repeatable, interval as an integer or a string with a
unit suffix, and the timestamp parameter on both trace endpoints.

Refs getsentry/toolkit#2073

Co-Authored-By: BYK <[email protected]>
@sentry-junior
sentry-junior Bot requested review from a team as code owners November 7, 2026 01:20
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 7, 2026
@BYK
BYK merged commit 8867b40 into master Nov 7, 2026
78 of 79 checks passed
@BYK
BYK deleted the docs/explore-timeseries-trace-params branch November 7, 2026 01:29
BYK added a commit to getsentry/toolkit that referenced this pull request Nov 7, 2026
Stacked on #2073. That PR moves the CLI onto the generated `@sentry/api`
operations. This one fixes the cases where the CLI, not the API docs,
was wrong. The full list is in getsentry/sentry#130351. Where the 1.44.0
operation now matches, the call moves onto it here too.

Each fix was checked against the getsentry/sentry endpoint code.

### Moved onto generated operations
| Area | Fix | Operation |
| --- | --- | --- |
| `alert issues list/view` | Filter workflows by `project` (the endpoint
ignores `projectSlug`) and send `id` as a number |
`listOrganizationWorkflows` (×2) |
| `code-mappings upload` | Send the bulk body in snake_case:
`default_branch`, `stack_root`, `source_root` |
`bulkUpsertOrganizationCodeMappings` |
| `explore`, `dashboard view` tables | Type `dataset` as a public Events
dataset. Explore still falls back to `errors`, and unmapped widget types
still render as unsupported | `listOrganizationEvents` (×2) |
| `issue view` and other org-scoped issue lookups | Send only the
`collapse` values the details endpoint reads (`release`, `stats`,
`tags`). It ignored `lifetime`/`filtered`/`unhandled`, and the detail
response keeps those fields either way. The short-ID endpoint still gets
every value | `getOrganizationIssue` |
| `issue view` replay lookup | Send `data_source=errors`. `events` isn't
a value the endpoint accepts | `getOrganizationReplayCount` |
| `issue explain/plan` | Drop `mode=explorer`, which the autofix
endpoint never reads | `startOrganizationIssueAutofix` (×2),
`getOrganizationIssueAutofixState` |

### Fixed, but still on the helper
- **`issue merge`**: now sends `{merge: true}` with numeric IDs.
`updateOrganizationIssues` marks every body field required until
getsentry/sentry#130348 lands.
- **`trace view`**: no longer sends `project` or `limit`, since the
endpoint reads neither. It stays on the helper until
getsentry/sentry#130349 documents `timestamp`. An unknown project in
`trace view org/project/<id>` still fails as before.
- **Dashboard and explore time series**: get the same typed `dataset`,
but stay on the helper until #130349 fixes `yAxis`/`interval`.
- **AI conversations list**: untouched, because it's waiting on
getsentry/sentry#130350 (`sort`).

### Kept on purpose
- **`replay list`** keeps requesting `info_ids` and `warning_ids`. The
server computes them and `replay list --json` prints them, so dropping
them would change the output. `fetchReplayPage` stays on the helper, and
a comment says why.

### Behavior notes
- On the moved calls, errors use the SDK wording already used by the
moved calls in #2073 and by the metric alert path, e.g. `Failed to list
issue alert rules: 403 Forbidden`. They no longer start with `API
request failed:`, and they no longer have an `Endpoint:` line. Status
codes and the 401/403 enrichment are unchanged.
- Existing bug, not fixed here: `trace view org/project/<id>` prints
"Filtered to project", but the trace endpoint has returned spans from
every project since getsentry/sentry#87314.
- Docs gap: with `returnIds=true`, the replay-count response maps each
issue ID to a list of replay IDs. The documented schema describes
counts. The CLI keeps validating that response with its own schema.

### Verification
- `pnpm run tsc` and `pnpm run lint` pass.
- CLI tests: 12884 pass and 5 fail. All 5 are the sandbox-only
permission tests that fail on `main` too (`completions` ×2, `upgrade`
acquireLock, `db/resilient` readonly, `dsn/code-scanner`).
- Unit tests were updated or added for each changed request shape,
including the new `test/lib/api/code-mappings.test.ts`.
- API discovery no longer lists the moved call sites.

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

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

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A80220b9d4c297e2a971f05dcb03af515)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A80220b9d4c297e2a971f05dcb03af515/?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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant