grafana/k6 · error

couldn't parse the otel proto: %w

Error message

couldn't parse the otel proto: %w

What it means

The proto token in the otel configuration line is not a recognized transport. params.parseProto only accepts specific protocol names for the OTLP client; any other value in -o otel=proto=... (typos, unsupported protocols) triggers this generic parse-guard error.

Source

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

	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)
			}
		default:
			if strings.HasPrefix(key, "header.") {
				params.parseHeader(key, value)
				continue
			}
			return params, fmt.Errorf("unknown otel config key %s", key)
		}
	}

	if params.proto == "grpc" && params.urlPath != "" {
		return params, ErrInvalidGRPCWithURLPath
	}

	return params, nil
}

func (p *tracerProviderParams) parseURL(s string) error {

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Use a supported protocol value, e.g. -o otel=proto=grpc or -o otel=proto=http
  2. Check for typos and casing in the proto value
  3. Omit proto= to use the default (grpc)
Defensive patterns

Strategy: validation

When it happens

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