{"record":{"id":"ce0dd4e310f9ff9a","repo":"grafana/k6","slug":"error-while-parsing-otel-configuration-w","errorCode":null,"errorMessage":"error while parsing otel configuration %w","messagePattern":"error while parsing otel configuration %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/lib/trace/otel.go","lineNumber":185,"sourceCode":"\treturn NewTracerProvider(ctx, params)\n}\n\nfunc tracerProviderParamsFromConfigLine(line string) (tracerProviderParams, error) {\n\tparams := defaultTracerProviderParams()\n\n\tif line == \"otel\" {\n\t\t// Use default params\n\t\treturn params, nil\n\t}\n\n\ttraceOutput, _, _ := strings.Cut(line, \"=\")\n\tif traceOutput != \"otel\" {\n\t\treturn params, fmt.Errorf(\"%w %q\", ErrInvalidTracesOutput, traceOutput)\n\t}\n\n\ttokens, err := strvals.Parse(line)\n\tif err != nil {\n\t\treturn params, fmt.Errorf(\"error while parsing otel configuration %w\", err)\n\t}\n\n\tfor _, token := range tokens {\n\t\tkey := token.Key\n\t\tvalue := token.Value\n\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"otel\":\n\t\t\terr = params.parseURL(value)\n\t\t\tif err != nil {\n\t\t\t\treturn params, fmt.Errorf(\"couldn't parse the otel URL: %w\", err)\n\t\t\t}\n\t\tcase \"proto\":\n\t\t\terr = params.parseProto(value)\n\t\t\tif err != nil {\n\t\t\t\treturn params, fmt.Errorf(\"couldn't parse the otel proto: %w\", err)\n\t\t\t}","sourceCodeStart":167,"sourceCodeEnd":203,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/lib/trace/otel.go#L167-L203","documentation":"The key=value portion of the otel configuration line could not be tokenized by the strvals parser. After the 'otel' prefix is accepted, the remainder is parsed as comma-separated key=value tokens; syntax errors such as a key without a value, unterminated arrays, or missing separators propagate here with their own detail wrapped inside.","triggerScenarios":"Thrown at internal/lib/trace/otel.go:185 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the underlying strvals syntax error described by the wrapped message (missing '=', stray commas, unclosed arrays)","Follow the form: -o otel=proto=grpc,endpoint=127.0.0.1:4317,header.x=1","Simplify the line to defaults (-o otel) and add options back one at a time"],"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"}