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 }}
Repository navigation
PromQL table-function backend has no response size limit: one wide range query can OOM the API #3836
With promqlBackend: table-function, queryRangeViaTableFunction (packages/api/src/controllers/timeseriesEngine.ts) caps the result at max_result_rows (100,000). Each row is a whole series with up to 11,000 samples, so the row cap doesn't bound the size. resp.json() then reads the whole body into memory.
A range query without aggregation over a large cluster, roughly rate(k8s_container_restarts[5m]) > 0 over 1 hour with one series per container, failed with Invalid string length. About a minute later the API process was OOM-killed (exit 137), and every user got 503s until it restarted.
The HTTP backends (prometheus, clickhouse-http) stop reading at PROMETHEUS_MAX_RESPONSE_BYTES (8 MB). On clickhouse-http, the same tile fails cleanly: "... returned more than 8 MB. Narrow the query or time range." The comment on that constant says both backends allow about the same amount of data. That holds for label lookups, but not for range queries.
Expected: the same bound on every backend, so one tile fails with a clear error instead of taking down the API. For example max_result_bytes next to max_result_rows in PROMQL_TABLE_FUNCTION_SETTINGS, or a bounded read of the response body.
Activity