{"record":{"id":"eaeae339240f81b3","repo":"grafana/k6","slug":"creating-tracerprovider-exporter-client-w","errorCode":null,"errorMessage":"creating TracerProvider exporter client: %w","messagePattern":"creating TracerProvider exporter client: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/lib/trace/otel.go","lineNumber":68,"sourceCode":"\turlPath  string\n\tinsecure bool\n\theaders  map[string]string\n}\n\nfunc defaultTracerProviderParams() tracerProviderParams {\n\treturn tracerProviderParams{\n\t\tproto:    \"grpc\",\n\t\tendpoint: \"127.0.0.1:4317\",\n\t\tinsecure: true,\n\t\theaders:  make(map[string]string),\n\t}\n}\n\n// NewTracerProvider creates a new tracer provider.\nfunc NewTracerProvider(ctx context.Context, params tracerProviderParams) (*TracerProvider, error) {\n\tclient, err := newClient(params)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating TracerProvider exporter client: %w\", err)\n\t}\n\n\texporter, err := otlptrace.New(ctx, client)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"creating TracerProvider exporter: %w\", err)\n\t}\n\n\tprov := sdktrace.NewTracerProvider(\n\t\tsdktrace.WithBatcher(exporter),\n\t\tsdktrace.WithResource(newResource()),\n\t)\n\n\t// Set a noop TracerProvider globally so usage of tracing\n\t// instrumentation is restricted to our own implementation\n\totel.SetTracerProvider(NewNoopTracerProvider())\n\n\treturn &TracerProvider{\n\t\tTracerProvider: prov,","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/lib/trace/otel.go#L50-L86","documentation":"Building the OTLP trace exporter client failed before any export was attempted. newClient constructs the grpc/http client from the trace provider params (endpoint, proto, insecure flag, headers); an unsupported protocol or invalid client configuration surfaces here, wrapped as the client-creation stage of NewTracerProvider.","triggerScenarios":"Thrown at internal/lib/trace/otel.go:68 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the -o otel=... configuration: endpoint URL, proto (grpc or http), and headers must be valid","Ensure the proto value is one of the supported transports for OTLP export","Verify the collector endpoint is syntactically correct (host:port for grpc, full URL for http)"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}