SigNoz/signoz · error · model.ApiError

filter operator %s not supported

Error message

filter operator %s not supported

What it means

ApiError (ErrorExec) from the filter-item-to-SQL builder (reader.go:615) when item.GetOperator() hits the default branch of the operator switch — the requested filter operator is not implemented for this query path (only startsWith/exists/notExists and siblings in the switch are handled).

Source

Thrown at pkg/query-service/app/clickhouseReader/reader.go:615

			subQuery, argsSubQuery = addInOperator(item, tagMapType, true)
		case model.LessThanEqualOperator:
			subQuery, argsSubQuery = addArithmeticOperator(item, tagMapType, "<=")
		case model.GreaterThanEqualOperator:
			subQuery, argsSubQuery = addArithmeticOperator(item, tagMapType, ">=")
		case model.ContainsOperator:
			subQuery, argsSubQuery = addContainsOperator(item, tagMapType, false)
		case model.NotContainsOperator:
			subQuery, argsSubQuery = addContainsOperator(item, tagMapType, true)
		case model.StartsWithOperator:
			subQuery, argsSubQuery = addStartsWithOperator(item, tagMapType, false)
		case model.NotStartsWithOperator:
			subQuery, argsSubQuery = addStartsWithOperator(item, tagMapType, true)
		case model.ExistsOperator:
			subQuery, argsSubQuery = addExistsOperator(item, tagMapType, false)
		case model.NotExistsOperator:
			subQuery, argsSubQuery = addExistsOperator(item, tagMapType, true)
		default:
			return "", nil, &model.ApiError{Typ: model.ErrorExec, Err: fmt.Errorf("filter operator %s not supported", item.GetOperator())}
		}
		query += subQuery
		args = append(args, argsSubQuery...)
	}
	return query, args, nil
}

func addInOperator(item model.TagQuery, tagMapType string, not bool) (string, []interface{}) {
	values := item.GetValues()
	args := []interface{}{}
	notStr := ""
	if not {
		notStr = "NOT"
	}
	tagValuePair := []string{}
	for _, value := range values {
		tagKey := "inTagKey" + String(5)
		tagValue := "inTagValue" + String(5)

View on GitHub (pinned to 5069bf80b0)

Solutions

  1. Remove or replace the unsupported operator in the filter item (use one of the implemented cases)
  2. Upgrade SigNoz query-service to a version supporting the operator
  3. Validate operators against the supported set before submitting the query
Defensive patterns

Strategy: validation

Validate before calling

var allowedOps = map[v3.FilterOperator]bool{v3.FilterOperatorEqual:true,v3.FilterOperatorIn:true,v3.FilterOperatorStartsWith:true,v3.FilterOperatorExists:true}
for _, it := range query.Filters {
    if !allowedOps[it.Operator] { return fmt.Errorf("operator %s not supported on this path", it.Operator) }
}

Type guard

func isSupportedFilterOp(op v3.FilterOperator) bool {
    switch op {
    case v3.FilterOperatorEqual, v3.FilterOperatorIn, v3.FilterOperatorStartsWith,
         v3.FilterOperatorExists, v3.FilterOperatorNotExists:
        return true
    }
    return false
}

Try / catch

// validate up front; on error surface which operator failed
if err := validateOperators(query.Filters); err != nil {
    http.Error(w, err.Error(), http.StatusBadRequest)
}

Prevention

When it happens

Trigger: Executing a trace/span query whose filter items use an operator outside the supported set for this builder (e.g. regex, greater-than on a string path), so no sub-query can be generated and the default branch returns the error.

Common situations: Frontend or API clients sending newer v3 filter operators to an older query-service that hasn't implemented them; copying filters from the logs QB into trace search where fewer operators are supported.

Related errors


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