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 nil

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Add a numeric threshold, e.g. "args":[100]
  2. 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

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


AI-assisted analysis of SigNoz/signoz@5069bf80b0 (2026-08-28). Data as JSON: /api/errors/07ff6f7d9917afae. Report an issue: GitHub.