grafana/k6 · error

error while parsing otel configuration %w

Error message

error while parsing otel configuration %w

What it means

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.

Source

Thrown at internal/lib/trace/otel.go:185

	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)
			}
		case "proto":
			err = params.parseProto(value)
			if err != nil {
				return params, fmt.Errorf("couldn't parse the otel proto: %w", err)
			}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Fix the underlying strvals syntax error described by the wrapped message (missing '=', stray commas, unclosed arrays)
  2. Follow the form: -o otel=proto=grpc,endpoint=127.0.0.1:4317,header.x=1
  3. Simplify the line to defaults (-o otel) and add options back one at a time
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at internal/lib/trace/otel.go:185 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/ce0dd4e310f9ff9a. Report an issue: GitHub.