{"record":{"id":"9cbc446b9915f2ac","repo":"SigNoz/signoz","slug":"invalid-series-aggregation-s","errorCode":null,"errorMessage":"invalid series aggregation: %s","messagePattern":"invalid series aggregation: (.+?)","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/model/v3/v3.go","lineNumber":821,"sourceCode":"type SecondaryAggregation string\n\nconst (\n\tSecondaryAggregationUnspecified SecondaryAggregation = \"\"\n\tSecondaryAggregationSum         SecondaryAggregation = \"sum\"\n\tSecondaryAggregationAvg         SecondaryAggregation = \"avg\"\n\tSecondaryAggregationMin         SecondaryAggregation = \"min\"\n\tSecondaryAggregationMax         SecondaryAggregation = \"max\"\n)\n\nfunc (s SecondaryAggregation) Validate() error {\n\tswitch s {\n\tcase SecondaryAggregationSum,\n\t\tSecondaryAggregationAvg,\n\t\tSecondaryAggregationMin,\n\t\tSecondaryAggregationMax:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid series aggregation: %s\", s)\n\t}\n}\n\ntype FunctionName string\n\nconst (\n\tFunctionNameCutOffMin   FunctionName = \"cutOffMin\"\n\tFunctionNameCutOffMax   FunctionName = \"cutOffMax\"\n\tFunctionNameClampMin    FunctionName = \"clampMin\"\n\tFunctionNameClampMax    FunctionName = \"clampMax\"\n\tFunctionNameAbsolute    FunctionName = \"absolute\"\n\tFunctionNameRunningDiff FunctionName = \"runningDiff\"\n\tFunctionNameLog2        FunctionName = \"log2\"\n\tFunctionNameLog10       FunctionName = \"log10\"\n\tFunctionNameCumSum      FunctionName = \"cumSum\"\n\tFunctionNameEWMA3       FunctionName = \"ewma3\"\n\tFunctionNameEWMA5       FunctionName = \"ewma5\"\n\tFunctionNameEWMA7       FunctionName = \"ewma7\"","sourceCodeStart":803,"sourceCodeEnd":839,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/model/v3/v3.go#L803-L839","documentation":"Thrown by SecondaryAggregation.Validate (series aggregation) when the value is not sum, avg, min, or max.","triggerScenarios":"Setting secondaryAggregation/series aggregation on a builder query to an unsupported value such as \"p95\" or \"\".","commonSituations":"Value-type panels with group by require SecondaryAggregation; developers set a percentile there assuming it's supported like space aggregation.","solutions":["Use one of sum/avg/min/max","If you need percentiles, use space aggregation instead and omit secondaryAggregation","Leave it empty when there is no group by on a value panel"],"exampleFix":"// before\n\"secondaryAggregation\":\"p95\"\n// after\n\"secondaryAggregation\":\"avg\"","handlingStrategy":"type-guard","validationCode":"if q.SecondaryAggregation != \"\" { if err := q.SecondaryAggregation.Validate(); err != nil { return err } }","typeGuard":"func isValidSeriesAgg(s v3.SecondaryAggregation) bool { return s.Validate() == nil }","tryCatchPattern":null,"preventionTips":["Remember only sum/avg/min/max are valid for series aggregation"],"tags":["go","enum-validation","series-aggregation"],"backgroundTag":"invalid-enum-value","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}