Repository navigation
docs(explore): Document repeated yAxis, interval units, and trace timestamp - #130349
Merged
Merged
Conversation
…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]>
BYK
approved these changes
Nov 7, 2026
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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three query parameters on public Explore endpoints were documented differently from what the code accepts:
yAxisonlistOrganizationEventsTimeserieswas a single string. The endpoint readsrequest.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 bylistOrganizationEventsTimeseriesandlistOrganizationEventsDropped) was an integer.get_rollup_from_requestparses it withparse_stats_period, which also takes a unit suffix such as5mor1h. It's nowanyOf: [integer, string matching ^\d+[smhdw]?$], so callers that pass a number keep working.timestampongetOrganizationTraceandgetOrganizationTraceMetawasn't listed. Both endpoints pass it toupdate_snuba_params_with_timestamp, which accepts ISO 8601 or Unix seconds and narrows the query window. I added it asTraceParams.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/apioperations (getsentry/toolkit#2073). Right now the generated types reject repeatedyAxis,interval=1handtimestamp. One thing to note for SDK consumers: the generatedyAxistype changes fromstringtostring[].Checked locally with
make build-api-docs,pnpm run validate-api-examples,tests/apidocs, prek and mypy. I also rantests/snuba/api/endpoints/test_organization_trace_meta.pyandtest_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]