{"record":{"id":"ebad2ae1bf186d22","repo":"grafana/k6","slug":"invalid-url-scheme-q","errorCode":null,"errorMessage":"invalid URL scheme: %q","messagePattern":"invalid URL scheme: %q","errorType":"validation","errorClass":"ErrInvalidURLScheme","httpStatus":null,"severity":"error","filePath":"internal/lib/trace/otel.go","lineNumber":227,"sourceCode":"\t\t\treturn params, fmt.Errorf(\"unknown otel config key %s\", key)\n\t\t}\n\t}\n\n\tif params.proto == \"grpc\" && params.urlPath != \"\" {\n\t\treturn params, ErrInvalidGRPCWithURLPath\n\t}\n\n\treturn params, nil\n}\n\nfunc (p *tracerProviderParams) parseURL(s string) error {\n\tu, err := url.Parse(s)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif u.Scheme != \"http\" && u.Scheme != \"https\" {\n\t\treturn fmt.Errorf(\"%w: %q\", ErrInvalidURLScheme, u.Scheme)\n\t}\n\n\tp.proto = \"http\"\n\tp.endpoint = u.Host\n\tp.urlPath = u.Path\n\tp.insecure = u.Scheme == \"http\"\n\n\treturn nil\n}\n\nfunc (p *tracerProviderParams) parseProto(proto string) error {\n\tif proto != \"http\" && proto != \"grpc\" {\n\t\treturn fmt.Errorf(\"%w: %q\", ErrInvalidProto, proto)\n\t}\n\n\tp.proto = proto\n\n\treturn nil","sourceCodeStart":209,"sourceCodeEnd":245,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/lib/trace/otel.go#L209-L245","documentation":"A validation guard in parseURL that wraps ErrInvalidURLScheme. It fires when the URL given in the otel config uses a scheme other than http or https (e.g. grpc:// or ftp://). The at-fault input is the malformed otel URL's scheme.","triggerScenarios":"Thrown at internal/lib/trace/otel.go:227 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an http:// or https:// URL for the otel endpoint","For gRPC protocol, set proto=grpc and give the host:port endpoint without a URL path","Check that the URL was not truncated or corrupted in the config"],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}