{"record":{"id":"a48e9d3275722e6e","repo":"grafana/k6","slug":"failed-parsing-threshold-expresion-s-q-right-hand","errorCode":null,"errorMessage":"failed parsing threshold expresion's %q right hand side; reason: %w","messagePattern":"failed parsing threshold expresion's %q right hand side; reason: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"metrics/thresholds_parser.go","lineNumber":90,"sourceCode":"func parseThresholdExpression(input string) (*thresholdExpression, error) {\n\t// Scanning makes no assumption on the underlying values, and only\n\t// checks that the expression has the right format.\n\tmethod, operator, value, err := scanThresholdExpression(input)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed parsing threshold expression %q; reason: %w\", input, err)\n\t}\n\n\tparsedMethod, parsedMethodValue, err := parseThresholdAggregationMethod(method)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"failed parsing threshold expression's %q left hand side; \"+\n\t\t\t\"reason: %w\", input, err,\n\t\t)\n\t\treturn nil, err\n\t}\n\n\tparsedValue, err := strconv.ParseFloat(value, 64)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"failed parsing threshold expresion's %q right hand side; \"+\n\t\t\t\"reason: %w\", input, err,\n\t\t)\n\t\treturn nil, err\n\t}\n\n\tcondition := &thresholdExpression{\n\t\tAggregationMethod: parsedMethod,\n\t\tAggregationValue:  parsedMethodValue,\n\t\tOperator:          operator,\n\t\tValue:             parsedValue,\n\t}\n\n\treturn condition, nil\n}\n\n// Define accepted threshold expression operators tokens\nconst (\n\ttokenLessEqual     = \"<=\"","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/metrics/thresholds_parser.go#L72-L108","documentation":"The right-hand side of the threshold expression failed to parse into a float64: after the operator was found, the value string is not a valid number (empty, contains non-numeric characters, or is a malformed decimal).","triggerScenarios":"Thrown at metrics/thresholds_parser.go:90 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Put a plain number after the operator, e.g. 'med<300' or 'rate==0.01'","Remove units, quotes, or variables from the right-hand side ('400ms' is invalid, use '400')","Check for typos like '<300,>' or double operators"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}