Handle rate-limited GLQL requests in embedded views and panels

What does this MR do and why?

Makes GLQL embedded views and dashboard panels handle rate-limited requests.

  • A 429 from /api/glql now counts as rate limited in classifyGlqlError. The existing 403 "Query temporarily blocked" lock, which pauses one query text after repeated timeouts, gets its own category, GLQL_ERROR_QUERY_PAUSED.
  • Embedded views show "Embedded view was rate limited. Try again later." for a 429, and "This embedded view timed out too often and is paused for up to 15 minutes. Add filters to narrow it, or try again later." for the lock, both with a Retry button. Before, a 429 showed the generic error, and the lock's 403 showed "You do not have permission to view this embedded view."
  • Dashboard panels show "The query was rate limited. Try again later." for a 429, and "The query timed out too often and is paused for up to 15 minutes. Select a shorter date range, or try again later." for the lock, both with Try again. Before, a 429 was classified as generic, and the lock had no Try again.
  • When Retry-After is 10 seconds or less, both retry once automatically, and an embedded view shows a loading skeleton while it waits. A second automatic retry needs a successful load in between, so it can't loop. Dashboard panels that already show rows (a failed continuation page) don't auto-retry, because a retry would drop them. Dashboard panels get a fresh automatic retry when their query, scope or filters change.
  • The GLQL Apollo client must never set a batchKey: a batched (multiplexed) body skips GLQL's rate limits. A spec pins it.

GitLab's rack-level rate limiter already answers 429 to some callers on this endpoint, and upcoming DB-time budgets answer 429 with Retry-After.

References

Screenshots or screen recordings

The error states were produced by stubbing fetch for /api/glql in the browser on GDK.

State Before After
Embedded view, 429 embedded_429_before embedded_429_after
Embedded view, timeout lock (403) embedded_lock_before embedded_lock_after
Dashboard panel, 429 panel_429_before panel_429_after
Dashboard panel, timeout lock (403) panel_lock_before panel_lock_after

With a short Retry-After, an embedded view shows a loading skeleton, then retries by itself:

Waiting After the retry
embedded_short_retry_skeleton_after embedded_short_retry_recovered_after

How to set up and validate locally

  1. Make /api/glql answer 429, for example by setting a low GLQL DB-time limit and enabling enforcement once the budgets MR is merged, or by returning a 429 from a browser request override for POST /api/glql.
  2. Open an issue or wiki page with a GLQL embedded view. It shows the rate-limited alert with a Retry button.
  3. Open a GLQL dashboard. Its panels show "The query was rate limited. Try again later." with Try again.
  4. Answer with Retry-After: 2. The view loads again after two seconds without user action.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Daniele Rossetti

Merge request reports

Loading
Loading