{"record":{"id":"8dcc0061ec04d21d","repo":"thanos-io/thanos","slug":"exceeded-maximum-resolution-of-11-000-points-per-t","errorCode":null,"errorMessage":"exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)","messagePattern":"exceeded maximum resolution of 11,000 points per timeseries\\. Try decreasing the query resolution \\(\\?step=XX\\)","errorType":"validation","errorClass":"api.ApiError","httpStatus":400,"severity":"error","filePath":"pkg/api/query/v1.go","lineNumber":795,"sourceCode":"\tif end.Before(start) {\n\t\terr := errors.New(\"end timestamp must not be before start time\")\n\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}\n\t}\n\n\tstep, apiErr := qapi.parseStep(r, qapi.defaultRangeQueryStep, int64(end.Sub(start)/time.Second))\n\tif apiErr != nil {\n\t\treturn nil, nil, apiErr, func() {}\n\t}\n\n\tif step <= 0 {\n\t\terr := errors.New(\"zero or negative query resolution step widths are not accepted. Try a positive integer\")\n\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}\n\t}\n\n\t// For safety, limit the number of returned points per timeseries.\n\t// This is sufficient for 60s resolution for a week or 1h resolution for a year.\n\tif end.Sub(start)/step > 11000 {\n\t\terr := errors.New(\"exceeded maximum resolution of 11,000 points per timeseries. Try decreasing the query resolution (?step=XX)\")\n\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}\n\t}\n\n\tctx := r.Context()\n\tif to := r.FormValue(\"timeout\"); to != \"\" {\n\t\tvar cancel context.CancelFunc\n\t\ttimeout, err := parseDuration(to)\n\t\tif err != nil {\n\t\t\treturn nil, nil, &api.ApiError{Typ: api.ErrorBadData, Err: err}, func() {}\n\t\t}\n\n\t\tctx, cancel = context.WithTimeout(ctx, timeout)\n\t\tdefer cancel()\n\t}\n\n\tenableDedup, apiErr := qapi.parseEnableDedupParam(r)\n\tif apiErr != nil {\n\t\treturn nil, nil, apiErr, func() {}","sourceCodeStart":777,"sourceCodeEnd":813,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/api/query/v1.go#L777-L813","documentation":"The Thanos Query API's range endpoint refuses to serve a query that would return more than 11,000 points per timeseries (end-start)/step > 11000. This is a safety limit to protect the querier from exhausting memory/CPU on huge range queries. It is returned wrapped in an ApiError of type ErrorBadData (HTTP 400).","triggerScenarios":"Calling the /api/v1/query_range endpoint where (end - start) / step exceeds 11000, e.g. start=now-90d, end=now with default step, or omitting step so a too-small default is used.","commonSituations":"Dashboarding tools (Grafana) requesting very long time ranges with 1m or smaller steps; ad-hoc curl queries over weeks of data at sub-minute resolution; after a version change that lowered the default step.","solutions":["Increase the step parameter (e.g. ?step=3600 for 1h resolution) so (end-start)/step <= 11000","Shrink the time range by setting a narrower start/end window","Split one large query into several smaller queries and merge client-side"],"exampleFix":"// before\nGET /api/v1/query_range?query=up&start=2024-01-01T00:00:00Z&end=2024-03-01T00:00:00Z&step=60s\n// after\nGET /api/v1/query_range?query=up&start=2024-01-01T00:00:00Z&end=2024-03-01T00:00:00Z&step=600s","handlingStrategy":"validation","validationCode":"if end.Sub(start)/step > 11000 {\n    step = end.Sub(start) / 11000 // round up to a safe step before calling the API\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Compute step = max(desiredStep, range/11000) before issuing query_range calls","Cap dashboard time pickers to ranges compatible with the panel step","Handle HTTP 400 with 'exceeded maximum resolution' by retrying with a coarser step"],"tags":["http-api","query-range","limit-exceeded"],"backgroundTag":"invalid-query-parameter","analyzedSha":"35b8b991177def87ed52dcf10f9b6d87f07282c8","analyzedAt":"2026-09-07T01:49:59.689Z","contentChangedAt":"2026-09-07T01:49:59.689Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}