{"record":{"id":"307fba37aec0dc54","repo":"thanos-io/thanos","slug":"query-fallback-to-prometheus-engine-not-analyzabl","errorCode":null,"errorMessage":"Query fallback to prometheus engine; not analyzable.","messagePattern":"Query fallback to prometheus engine; not analyzable\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"pkg/api/query/v1.go","lineNumber":456,"sourceCode":"\treturn nil, &api.ApiError{Typ: api.ErrorBadData, Err: errors.Errorf(\"Query not explainable\")}\n}\n\nfunc (qapi *QueryAPI) parseQueryAnalyzeParam(r *http.Request) bool {\n\treturn (r.FormValue(QueryAnalyzeParam) == \"true\" || r.FormValue(QueryAnalyzeParam) == \"1\")\n}\n\nfunc analyzeQueryOutput(query promql.Query, engineType PromqlEngineType, tracker *fanout.Tracker) (queryTelemetry, error) {\n\tif eq, ok := query.(engine.ExplainableQuery); ok {\n\t\tif analyze := eq.Analyze(); analyze != nil {\n\t\t\treturn processAnalysis(analyze, tracker), nil\n\t\t} else {\n\t\t\treturn queryTelemetry{}, errors.Errorf(\"Query: %v not analyzable\", query)\n\t\t}\n\t}\n\n\tvar warning error\n\tif engineType == PromqlEngineThanos {\n\t\twarning = errors.New(\"Query fallback to prometheus engine; not analyzable.\")\n\t} else {\n\t\twarning = errors.New(\"Query not analyzable; change engine to 'thanos'.\")\n\t}\n\n\treturn queryTelemetry{}, warning\n}\n\nfunc processAnalysis(a *engine.AnalyzeOutputNode, tracker *fanout.Tracker) queryTelemetry {\n\tvar analysis queryTelemetry\n\tanalysis.OperatorName = a.OperatorTelemetry.String()\n\tanalysis.Execution = a.OperatorTelemetry.ExecutionTimeTaken().String()\n\tanalysis.PeakSamples = a.PeakSamples()\n\tanalysis.TotalSamples = a.TotalSamples()\n\tif stores := tracker.Get(a.OperatorID); len(stores) > 0 {\n\t\tanalysis.Fanout = make([]fanoutEntry, 0, len(stores))\n\t\tfor _, s := range stores {\n\t\t\tanalysis.Fanout = append(analysis.Fanout, fanoutEntry{\n\t\t\t\tEndpointAddr:   s.EndpointAddr,","sourceCodeStart":438,"sourceCodeEnd":474,"githubUrl":"https://github.com/thanos-io/thanos/blob/35b8b991177def87ed52dcf10f9b6d87f07282c8/pkg/api/query/v1.go#L438-L474","documentation":"When the query does not implement ExplainableQuery (the query fell back to the plain Prometheus engine) and the requested engine was 'thanos', analyzeQueryOutput returns this warning indicating the analysis is unavailable because of the fallback. The query itself still executes; only the analysis telemetry is missing.","triggerScenarios":"query/queryRange with analyze enabled while the Thanos engine fell back to the Prometheus engine (e.g. Thanos engine unavailable or query unsupported by the Thanos engine).","commonSituations":"Thanos engine disabled at startup or failing to initialize; operators requesting analysis on queries the Thanos engine cannot execute; feature-flag rollouts mid-migration.","solutions":["Check query-frontend/gateway logs for why the Thanos engine fell back and fix the underlying cause.","Ensure the Thanos engine is enabled/healthy so the query does not fall back.","Treat it as a soft warning: the query results are still valid, only analysis is absent."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"const body = await res.json();\nif (body.status === 'error' && /fallback to prometheus engine/.test(body.error)) {\n  // results may still be present; degrade analysis UI and alert on fallback frequency\n}","preventionTips":["Monitor Thanos engine health to avoid silent fallbacks.","Track how often this warning appears; frequent occurrences mean the engine is misconfigured.","Surface engine fallback in dashboards so operators notice."],"tags":["http-api","promql","analyze","engine-fallback"],"backgroundTag":"fallback-engine-selected","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"}