SigNoz/signoz · error

invalid function name: %s

Error message

invalid function name: %s

What it means

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).

Source

Thrown at pkg/query-service/model/v3/v3.go:868

		FunctionNameCutOffMax,
		FunctionNameClampMin,
		FunctionNameClampMax,
		FunctionNameAbsolute,
		FunctionNameRunningDiff,
		FunctionNameLog2,
		FunctionNameLog10,
		FunctionNameCumSum,
		FunctionNameEWMA3,
		FunctionNameEWMA5,
		FunctionNameEWMA7,
		FunctionNameMedian3,
		FunctionNameMedian5,
		FunctionNameMedian7,
		FunctionNameTimeShift,
		FunctionNameAnomaly:
		return nil
	default:
		return fmt.Errorf("invalid function name: %s", f)
	}
}

type Function struct {
	Name      FunctionName           `json:"name"`
	Args      []interface{}          `json:"args,omitempty"`
	NamedArgs map[string]interface{} `json:"namedArgs,omitempty"`
}

type MetricTableHints struct {
	TimeSeriesTableName string
	SamplesTableName    string
}

type MetricValueFilter struct {
	Value float64
}

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Use exact function names from the FunctionName constants (e.g. "anomaly", "time_shift")
  2. Remove functions unsupported by your server version
  3. Check available functions in the query builder UI of the same version

Example fix

// before
{"functions":[{"name":"timeShift"}]}
// after
{"functions":[{"name":"time_shift"}]}
Defensive patterns

Strategy: validation

Validate before calling

for _, f := range q.Functions { if err := f.Name.Validate(); err != nil { return fmt.Errorf("function %s unsupported", f.Name) } }

Type guard

func isValidFunction(n v3.FunctionName) bool { return n.Validate() == nil }

Prevention

When it happens

Trigger: Adding a function like "anomaly_score" or "timeShift" (wrong casing) to BuilderQuery.Functions.

Common situations: Applying v2-era or made-up function names, or version mismatch where a function exists only in newer query service builds.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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