{"record":{"id":"13dd15cd5936a74a","repo":"SigNoz/signoz","slug":"unsupported-aggregate-operator-13dd15","errorCode":null,"errorMessage":"unsupported aggregate operator","messagePattern":"unsupported aggregate operator","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/app/metrics/v3/delta.go","lineNumber":156,"sourceCode":"\t\top := \"toFloat64(count(distinct(value)))\"\n\t\tquery := fmt.Sprintf(queryTmpl, groupTags, step, op, filterSubQuery, groupBy, orderBy)\n\t\treturn query, nil\n\tcase v3.AggregateOperatorNoOp:\n\t\tqueryTmpl :=\n\t\t\t\"SELECT fingerprint, labels as fullLabels,\" +\n\t\t\t\t\" toStartOfInterval(toDateTime(intDiv(unix_milli, 1000)), INTERVAL %d SECOND) as ts,\" +\n\t\t\t\t\" any(value) as value\" +\n\t\t\t\t\" FROM \" + constants.SIGNOZ_METRIC_DBNAME + \".\" + constants.SIGNOZ_SAMPLES_V4_TABLENAME +\n\t\t\t\t\" INNER JOIN\" +\n\t\t\t\t\" (%s) as filtered_time_series\" +\n\t\t\t\t\" USING fingerprint\" +\n\t\t\t\t\" WHERE \" + samplesTableTimeFilter +\n\t\t\t\t\" GROUP BY fingerprint, labels, ts\" +\n\t\t\t\t\" ORDER BY fingerprint, labels, ts\"\n\t\tquery := fmt.Sprintf(queryTmpl, step, filterSubQuery)\n\t\treturn query, nil\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unsupported aggregate operator\")\n\t}\n}\n","sourceCodeStart":138,"sourceCodeEnd":159,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/app/metrics/v3/delta.go#L138-L159","documentation":"In buildDeltaMetricQuery (used by PrepareMetricQuery for delta/gauge-style metric queries), the switch over AggregateOperator reached its default branch: the requested aggregator is not implemented for this query shape. The message is generic because any unknown/unimplemented operator lands here, unlike the explicitly rejected ones in table view.","triggerScenarios":"A v3 metrics query whose dataSource/panel type routes to the delta builder with an unsupported AggregateOperator (e.g. noop, or a newer operator constant the deployed query-service doesn't handle). PrepareMetricQuery calls buildDeltaMetricQuery and the default branch returns the error.","commonSituations":"Version skew between SigNoz frontend and query-service after a partial upgrade; hand-crafted API requests with custom operator strings; operators valid for table view but not implemented in the delta path.","solutions":["Use an implemented operator for this query type (sum, avg, min, max, rate variants depending on builder)","Upgrade (or align) frontend and query-service so operator sets match","Log the exact operator value server-side/client-side to identify the mismatch, then fix the request"],"exampleFix":"// before\nreq.AggregateAttribute.AggregateOperator = v3.AggregateOperatorNoOp\n// after\nreq.AggregateAttribute.AggregateOperator = v3.AggregateOperatorAvg","handlingStrategy":"validation","validationCode":"if !isKnownAggregateOperator(req.AggregateOperator) {\n  return fmt.Errorf(\"unsupported aggregate operator %q for this query type\", req.AggregateOperator)\n}","typeGuard":"func isSupportedDeltaOperator(op string) bool { return isKnownAggregateOperator(op) && op != \"noop\" }","tryCatchPattern":"Catch the error from PreparePipeline/PrepareMetricQuery call chain, inspect the operator, and surface a config error; deterministic — no retry.","preventionTips":["Centralize the operator enum in one shared package across services","Add server-side compatibility matrix tests per builder","Upgrade services together to avoid operator-constant skew"],"tags":["signoz","metrics","aggregate-operator","delta-query"],"backgroundTag":"unsupported-aggregate-operator","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}