jaegertracing/jaeger · error

unrecognized exporter type %s

Error message

unrecognized exporter type %s

What it means

createOtelExporter (cmd/tracegen/main.go:144) returns this error when the exporterType flag value does not match any supported switch case: otlp, otlp-http, otlp-grpc, or stdout. The legacy "jaeger" exporter is rejected separately with its own message because it was removed. tracegen fails fast at startup with this message plus the unrecognized value.

Source

Thrown at cmd/tracegen/main.go:144

	var exporter sdktrace.SpanExporter
	var err error
	switch exporterType {
	case "jaeger":
		return nil, errors.New("jaeger exporter is no longer supported, please use otlp")
	case "otlp", "otlp-http":
		client := otlptracehttp.NewClient(
			otlptracehttp.WithInsecure(),
		)
		exporter, err = otlptrace.New(context.Background(), client)
	case "otlp-grpc":
		client := otlptracegrpc.NewClient(
			otlptracegrpc.WithInsecure(),
		)
		exporter, err = otlptrace.New(context.Background(), client)
	case "stdout":
		exporter, err = stdouttrace.New()
	default:
		return nil, fmt.Errorf("unrecognized exporter type %s", exporterType)
	}
	return exporter, err
}

View on GitHub (pinned to 806f444784)

Solutions

  1. Use one of the supported values: otlp or otlp-http (HTTP client), otlp-grpc (gRPC client), or stdout for console output
  2. If you intended the legacy jaeger exporter, switch to otlp/otlp-grpc — it was removed from tracegen
  3. Point the exporter at a collector that accepts OTLP (e.g. set OTEL_EXPORTER_OTLP_ENDPOINT) when using otlp* types

Example fix

// before
// go run ./cmd/tracegen --exporter=jaeger-remote ...
// after
// go run ./cmd/tracegen --exporter=otlp-grpc ...
Defensive patterns

Strategy: validation

Validate before calling

supported := map[string]bool{"otlp": true, "otlp-http": true, "otlp-grpc": true, "stdout": true}
if !supported[exporterType] {
	return fmt.Errorf("exporter must be one of otlp, otlp-http, otlp-grpc, stdout; got %q", exporterType)
}

Try / catch

exporter, err := createOtelExporter(exporterType)
if err != nil {
	if strings.Contains(err.Error(), "unrecognized exporter type") {
		flag.Usage() // print supported values and exit
	}
	os.Exit(1)
}

Prevention

When it happens

Trigger: Running tracegen with an exporter value that is not exactly one of: otlp, otlp-http, otlp-grpc, stdout (case-sensitive exact match). Examples: --exporter jaeger-remote, --exporter OTLP (uppercase), --exporter otlpgrpc (missing hyphen), --exporter prometheus.

Common situations: Users following older Jaeger docs or blog posts referencing the removed jaeger exporter; shell scripts or Makefiles with a stale exporter name; confusion between otlp-grpc vs otlpgrpc or otlp-http vs otlphttp.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/44828c750b71a817. Report an issue: GitHub.