{"record":{"id":"fd9f8a9754bb00ba","repo":"grafana/k6","slug":"creating-tracerprovider-exporter-w","errorCode":null,"errorMessage":"creating TracerProvider exporter: %w","messagePattern":"creating TracerProvider exporter: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/lib/trace/otel.go","lineNumber":73,"sourceCode":"func 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,\n\t\tshutdown:       prov.Shutdown,\n\t}, nil\n}\n\nfunc newResource() *resource.Resource {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/lib/trace/otel.go#L55-L91","documentation":"otlptrace.New could not create the span exporter from the freshly built client. This is the exporter-construction stage of NewTracerProvider; it fails on invalid exporter options or client setup problems, before the tracer provider is registered and before any connection to the collector is guaranteed.","triggerScenarios":"Thrown at internal/lib/trace/otel.go:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Validate the OTLP configuration line; retry with default settings (-o otel) to isolate the issue","Upgrade k6; exporter construction bugs are fixed over time","Check that the chosen client protocol and endpoint combination is supported by the collector"],"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"}