docs(queries): document how to see what is using a concurrency limit, and how to read the limits themselves - #320
Merged
Conversation
tomaz-lc
marked this pull request as ready for review
July 30, 2026 07:01
tomaz-lc
enabled auto-merge (squash)
July 30, 2026 07:02
… and how to read the limits themselves
The query-limits page stated the concurrency limit and what happens when it
is reached, but not how to find out what is consuming it, nor how to learn
what the limits actually are for a given organization. Both are answerable
through the API, so document them.
Adds two sections:
- Seeing What Is Using Your Limit, covering GET /v1/search/{oid}/queries
with CLI, Python SDK, Go SDK and REST examples, sample CLI table output,
a representative JSON response showing one executing and one idle query,
and a field-by-field table. The distinction the listing exists to make is
that the searches an organization has open and the subset consuming its
limit are different numbers, because a paginated query between pages is
open and resumable but holds no slot. The field table calls out the three
ways an optional field is misread as a zero: holdsSlot is null only when
the state is unknown, hasMorePages is absent until a page has completed
and absent means "not yet determined", and batchesInScope of 0 means the
scope estimate was unavailable rather than that nothing has been done.
- Reading Your Limits Directly, covering GET /v1/search/{oid}/limits with
the same four tabs, a representative response and a table covering every
field in it.
Both carry the convention a reader has to know: a limit that is not enforced
is reported as null, not 0, and an unrecognised field means not applicable to
that deployment rather than zero.
The SDK examples are compiled snippets under snippets/ rather than inline
code, so CI type-checks them against the published SDKs. The Go limits
snippet demonstrates the nil-versus-zero handling on the execution limits,
which is the contract a Go caller can silently get wrong.
Cancelling a query is documented as REST-only, with a concrete DELETE example
both where cancelling is introduced and in the 429 troubleshooting entry, so
the recovery path does not end at a step the reader cannot perform. The REST
examples reuse the $SEARCH_HOST and $LC_JWT convention established on the
Query Console page rather than re-deriving the host, and both endpoints note
the insight.evt.get permission they require.
Also adds a troubleshooting entry for a paginated query that cannot be
resumed. The resumable window is measured from when the query was submitted,
not from its last page, so one left paused long enough expires even though it
was producing pages recently - which is the non-obvious part and the likely
cause. Distinguishes it from the page-retention window, where re-reading an
aged-out page recomputes it and shows up as a slow page rather than a broken
one. The existing rate-limit entry now points at the limits endpoint for
confirming what the cap actually is before investigating.
The Go snippet module pin is moved forward to the SDK revision that adds
GetSearchLimits / ListOpenQueries. That revision is not a tagged release yet,
so the pin has to move to a tagged version before this lands.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
tomaz-lc
force-pushed
the
feat-list-active-search-queries
branch
from
July 30, 2026 07:13
beee973 to
43dc899
Compare
auto-merge was automatically disabled
July 30, 2026 07:17
Pull Request is not mergeable
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.
Details
The query-limits page stated the concurrent-query limit and what happens when it is reached, but not how to find out what is consuming it, nor how to learn what the limits actually are for a given organization. Both are now answerable through the API, so this documents them.
Adds two sections and one troubleshooting entry.
Seeing What Is Using Your Limit covers the distinction the open-query listing exists to make: the searches an organization has open and the subset consuming its limit are different numbers, because a paginated query between pages is open and resumable but holds no slot. It has CLI, Python SDK, Go SDK and REST examples, sample CLI table output showing one executing and one idle query, a representative JSON response with the same mix so the
slotsHeldversuscountdistinction is visible in the data and not only in prose, and a field-by-field table for a query entry. The table calls out the three optional fields that are easy to misread as zeros:holdsSlotisnullonly when the state isunknown,hasMorePagesis absent until a page has completed and absent means "not yet determined" rather than "no more pages", andbatchesInScopeof0means the scope estimate was unavailable so progress cannot be computed, not that no work has been done.Reading Your Limits Directly covers the limits endpoint, with the same four tabs, a representative response and a field-by-field table covering every field in that response. The framing is "ask rather than discover": every limit on the page was previously learnable only by hitting it.
A paginated query cannot be resumed is a new troubleshooting entry. The resumable window is measured from when the query was submitted, not from its last page, so one left paused long enough expires even though it was producing pages recently. That is the non-obvious part and the likely cause. It also distinguishes that window from page retention, where re-reading an aged-out page recomputes it and shows up as a slow page rather than a broken one.
The existing rate-limit troubleshooting entry now points at the limits endpoint for confirming what the cap actually is, before investigating what is holding it. Because there is no CLI cancel command, that entry carries a concrete
DELETE /v1/search/{queryId}example at the point of use and states plainly that cancelling is available through the REST API only, so the recovery path does not end at a step the reader cannot perform.Both endpoints note the
insight.evt.getpermission they require and link to the API Keys page, and both REST tabs use the$SEARCH_HOST/$LC_JWTconvention established on the Query Console page rather than re-deriving the search host inline.Go snippet module pin points at an unreleased SDK revision
snippets/golang/go.modis moved fromv0.0.0-20260706232626-4212dfffc585tov0.0.0-20260726172822-e1078d02bc52. That newer pseudo-version is the commit on the Go SDK branch that addsGetSearchLimits/ListOpenQueries/ListAllOpenQueries; it is not a tagged release. The snippet build (go build ./...+go vet ./...) passes against it today, but this pin must be moved to a tagged release before this PR merges, otherwise the documentation's snippet build depends on an unmerged branch revision that can disappear.The Python side has no equivalent problem: the Python snippet job only byte-compiles with
py_compileand verifies that thelimacharlie.sdk.searchimport path resolves, neither of which touches the new methods, so the Python snippets are safe against the currently pinnedlimacharlie==5.5.1.Conventions a reader has to know, stated in both new sections
A limit that is not enforced is reported as
null, not0- in a document of limits a zero would read as "nothing allowed". An unrecognised field means "not applicable to this deployment" rather than zero, since the response is additive and gains fields over time.Blast radius / isolation
One documentation page,
docs/4-data-queries/query-limits-and-performance.md. Additive: two new sections and one new troubleshooting entry, plus edits to an existing troubleshooting bullet. No existing section is rewritten or removed, and no other page changes.Four new compiled snippets are added and included with
--8<--so CI type-checks the SDK examples against the published SDKs instead of letting hand-written inline code drift:snippets/python/search_limits.pysnippets/python/open_queries.pysnippets/golang/search_limits/main.gosnippets/golang/open_queries/main.goThe Go limits snippet deliberately demonstrates the nil-versus-zero handling on the execution limits, since that is the contract a Go caller can silently get wrong: those fields are
*int64andnilmeans "not enforced".Verification
cd snippets/golang && go build ./... && go vet ./...passes with the bumped pin (and withGOFLAGS=-mod=readonly, as CI runs it).python3 -m py_compile snippets/python/search_limits.py snippets/python/open_queries.pypasses.mkdocs build --strictpasses, and the rendered page contains the snippet bodies, so every--8<--path resolves.npx markdownlint-cli2reports 0 issues, andscripts/check-list-numbering.pyreports 0 new numbering breaks.Notable contracts / APIs
Documents existing API responses; nothing here defines or changes a contract. Both endpoints are gated server-side, so the text avoids implying either is universally available - the limits response carries
capabilities.openQueryListingfor exactly that reason, and the page explains it.Related PRs
go.modpin bump above🤖 Generated with Claude Code