grafana/k6 · error
unsupported exporter protocol %q, only %q and %q are support
Error message
unsupported exporter protocol %q, only %q and %q are supported
What it means
Validate's exporter-protocol subcheck found K6_OTEL_EXPORTER_PROTOCOL set to a value other than the two supported protocols ("grpc" and "http/protobuf"). This is a sentinel-style guard on the protocol string.
Source
Thrown at internal/output/opentelemetry/config.go:226
func (cfg Config) Validate() error {
if cfg.ServiceName.String == "" {
return errors.New("providing service name is required")
}
// TODO: it's not actually required, but we should probably have a default
// check if it works without it
if cfg.ServiceVersion.String == "" {
return errors.New("providing service version is required")
}
if err := cfg.validateExporterProtocol(); err != nil {
return err
}
return nil
}
func (cfg Config) validateExporterProtocol() error {
if cfg.ExporterProtocol.String != "" {
if cfg.ExporterProtocol.String != grpcExporterProtocol && cfg.ExporterProtocol.String != httpExporterProtocol {
return fmt.Errorf(
"unsupported exporter protocol %q, only %q and %q are supported",
cfg.ExporterProtocol.String,
grpcExporterProtocol,
httpExporterProtocol,
)
}
switch cfg.ExporterProtocol.String {
case grpcExporterProtocol:
if cfg.GRPCExporterEndpoint.String == "" {
return errors.New("gRPC exporter endpoint is required")
}
case httpExporterProtocol:
endpoint := cfg.HTTPExporterEndpoint.String
if endpoint == "" {
return errors.New("HTTP exporter endpoint is required")
}
if strings.HasPrefix(endpoint, "http://") ||View on GitHub (pinned to 01ffac6f24)
Solutions
- Set K6_OTEL_EXPORTER_PROTOCOL=grpc or K6_OTEL_EXPORTER_PROTOCOL=http/protobuf
- Unset the variable to use the default protocol
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at internal/output/opentelemetry/config.go:226 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/5969d5c3898cfcee.
Report an issue: GitHub.