grafana/k6 · error · ErrInvalidTracesOutput
invalid traces output %q
Error message
invalid traces output %q
What it means
The -o/--traces-output value does not start with 'otel' (the only supported traces output). The config line is cut at the first '=' and the prefix checked; anything other than the literal 'otel' (or the bare 'otel' short form) wraps ErrInvalidTracesOutput with the offending prefix quoted in the message.
Source
Thrown at internal/lib/trace/otel.go:180
params, err := tracerProviderParamsFromConfigLine(line)
if err != nil {
return nil, err
}
return NewTracerProvider(ctx, params)
}
func tracerProviderParamsFromConfigLine(line string) (tracerProviderParams, error) {
params := defaultTracerProviderParams()
if line == "otel" {
// Use default params
return params, nil
}
traceOutput, _, _ := strings.Cut(line, "=")
if traceOutput != "otel" {
return params, fmt.Errorf("%w %q", ErrInvalidTracesOutput, traceOutput)
}
tokens, err := strvals.Parse(line)
if err != nil {
return params, fmt.Errorf("error while parsing otel configuration %w", err)
}
for _, token := range tokens {
key := token.Key
value := token.Value
var err error
switch key {
case "otel":
err = params.parseURL(value)
if err != nil {
return params, fmt.Errorf("couldn't parse the otel URL: %w", err)
}View on GitHub (pinned to 01ffac6f24)
Solutions
- Use -o otel or -o otel=key=value,... for OTLP trace export
- Remove the unsupported output name shown in the error
- Check for typos and leading whitespace in the output option
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/lib/trace/otel.go:180 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of grafana/k6@01ffac6f24 (2026-08-18).
Data as JSON: /api/errors/15533af3f4b163bc.
Report an issue: GitHub.