{"record":{"id":"f1fed78bb33aa050","repo":"SigNoz/signoz","slug":"invalid-function-name-s","errorCode":null,"errorMessage":"invalid function name: %s","messagePattern":"invalid function name: (.+?)","errorType":"validation","errorClass":null,"httpStatus":400,"severity":"error","filePath":"pkg/query-service/model/v3/v3.go","lineNumber":868,"sourceCode":"\t\tFunctionNameCutOffMax,\n\t\tFunctionNameClampMin,\n\t\tFunctionNameClampMax,\n\t\tFunctionNameAbsolute,\n\t\tFunctionNameRunningDiff,\n\t\tFunctionNameLog2,\n\t\tFunctionNameLog10,\n\t\tFunctionNameCumSum,\n\t\tFunctionNameEWMA3,\n\t\tFunctionNameEWMA5,\n\t\tFunctionNameEWMA7,\n\t\tFunctionNameMedian3,\n\t\tFunctionNameMedian5,\n\t\tFunctionNameMedian7,\n\t\tFunctionNameTimeShift,\n\t\tFunctionNameAnomaly:\n\t\treturn nil\n\tdefault:\n\t\treturn fmt.Errorf(\"invalid function name: %s\", f)\n\t}\n}\n\ntype Function struct {\n\tName      FunctionName           `json:\"name\"`\n\tArgs      []interface{}          `json:\"args,omitempty\"`\n\tNamedArgs map[string]interface{} `json:\"namedArgs,omitempty\"`\n}\n\ntype MetricTableHints struct {\n\tTimeSeriesTableName string\n\tSamplesTableName    string\n}\n\ntype MetricValueFilter struct {\n\tValue float64\n}\n","sourceCodeStart":850,"sourceCodeEnd":886,"githubUrl":"https://github.com/SigNoz/signoz/blob/5069bf80b08f1f00d7e014eccc09902f9871004f/pkg/query-service/model/v3/v3.go#L850-L886","documentation":"Thrown by FunctionName.Validate when a function applied to a builder query is not in the allowed set (cutOffMin/Max, histogram, log trends, median3/5/7, time_shift, anomaly).","triggerScenarios":"Adding a function like \"anomaly_score\" or \"timeShift\" (wrong casing) to BuilderQuery.Functions.","commonSituations":"Applying v2-era or made-up function names, or version mismatch where a function exists only in newer query service builds.","solutions":["Use exact function names from the FunctionName constants (e.g. \"anomaly\", \"time_shift\")","Remove functions unsupported by your server version","Check available functions in the query builder UI of the same version"],"exampleFix":"// before\n{\"functions\":[{\"name\":\"timeShift\"}]}\n// after\n{\"functions\":[{\"name\":\"time_shift\"}]}","handlingStrategy":"validation","validationCode":"for _, f := range q.Functions { if err := f.Name.Validate(); err != nil { return fmt.Errorf(\"function %s unsupported\", f.Name) } }","typeGuard":"func isValidFunction(n v3.FunctionName) bool { return n.Validate() == nil }","tryCatchPattern":null,"preventionTips":["Check function availability for your server version before exposing in UI"],"tags":["go","enum-validation","functions"],"backgroundTag":"invalid-enum-value","analyzedSha":"5069bf80b08f1f00d7e014eccc09902f9871004f","analyzedAt":"2026-08-28T06:22:12.824Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}