grafana/k6 · error

couldn't parse the otel URL: %w

Error message

couldn't parse the otel URL: %w

What it means

The endpoint value given via the otel= URL/endpoint setting could not be parsed by params.parseURL. This is a generic guard over the endpoint string — the input at fault is the endpoint/URL token in the -o otel=... configuration line — and fires on malformed URLs or endpoints that do not match the expected format.

Source

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

	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)
			}
		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
	}

View on GitHub (pinned to 01ffac6f24)

Solutions

  1. Provide a well-formed endpoint, e.g. otel=grpc://127.0.0.1:4317 or a host:port / URL accepted by the parser
  2. Check for typos, missing port, or unsupported URL scheme
  3. Compare against the working default endpoint 127.0.0.1:4317
Defensive patterns

Strategy: validation

When it happens

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