SigNoz/signoz · error
threshold param missing in query
Error message
threshold param missing in query
What it means
cutOffMax/cutOffMin/clampMax/clampMin require a threshold argument. Validate() returns this when Args is empty for those functions.
Source
Thrown at pkg/query-service/model/v3/v3.go:1150
}
alpha, ok := function.Args[0].(float64)
if !ok {
// if string, attempt to convert to float
alpha, err := strconv.ParseFloat(function.Args[0].(string), 64)
if err != nil {
return fmt.Errorf("alpha param should be a float")
}
function.Args[0] = alpha
}
if alpha < 0 || alpha > 1 {
return fmt.Errorf("alpha param should be between 0 and 1")
}
} else if function.Name == FunctionNameCutOffMax ||
function.Name == FunctionNameCutOffMin ||
function.Name == FunctionNameClampMax ||
function.Name == FunctionNameClampMin {
if len(function.Args) == 0 {
return fmt.Errorf("threshold param missing in query")
}
_, ok := function.Args[0].(float64)
if !ok {
// if string, attempt to convert to float
if _, ok := function.Args[0].(string); !ok {
return fmt.Errorf("threshold param should be a float")
}
threshold, err := strconv.ParseFloat(function.Args[0].(string), 64)
if err != nil {
return fmt.Errorf("threshold param should be a float")
}
function.Args[0] = threshold
}
}
}
}
return nilView on GitHub (pinned to 5069bf80b0)
Solutions
- Add a numeric threshold, e.g. "args":[100]
- Make the threshold field required in whatever produces the query
Example fix
// before
{"name":"cutOffMax"}
// after
{"name":"cutOffMax","args":[100]} Defensive patterns
Strategy: validation
Validate before calling
needsThreshold := map[string]bool{"cutOffMax":true,"cutOffMin":true,"clampMax":true,"clampMin":true}
if needsThreshold[string(f.Name)] && len(f.Args) == 0 { return errors.New("threshold required") } Type guard
func thresholdProvided(f v3.Function) bool { return !map[string]bool{"cutOffMax":true,"cutOffMin":true,"clampMax":true,"clampMin":true}[string(f.Name)] || len(f.Args) > 0 } Prevention
- Make threshold a required UI field for clamp/cutOff functions
When it happens
Trigger: "functions":[{"name":"cutOffMax"}] with no args array.
Common situations: Query-builder UI state where the threshold input was left blank; programmatic query assembly skipping empty inputs entirely instead of erroring early.
Related errors
- error building clickhouse query: %v
- invalid expression %s: %v
- live tail is only supported for single query
- invalid data type for resource attribute: %s
- unsupported operation, exists and not exists can only be app
AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28).
Data as JSON: /api/errors/07ff6f7d9917afae.
Report an issue: GitHub.