From 135f0fbfb1f88fdd49a90f5fd929293dba3843c8 Mon Sep 17 00:00:00 2001 From: jonny rhea Date: Thu, 1 Jan 2026 13:43:50 -0600 Subject: [PATCH] fix issue with endpoint configuration --- cmd/utils/otel.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/utils/otel.go b/cmd/utils/otel.go index 31abd883ba..8534f3b631 100644 --- a/cmd/utils/otel.go +++ b/cmd/utils/otel.go @@ -60,12 +60,10 @@ func SetupOTEL(ctx *cli.Context) (*otelService, error) { if !ctx.Bool(OTELEnabledFlag.Name) { return nil, nil } - endpoint := ctx.String(OTELEndpointFlag.Name) if endpoint == "" { return nil, nil } - serviceName := ctx.String(OTELServiceNameFlag.Name) setupCtx := ctx.Context if setupCtx == nil { @@ -82,11 +80,14 @@ func SetupOTEL(ctx *cli.Context) (*otelService, error) { switch u.Scheme { case "http", "https": opts := []otlptracehttp.Option{ - otlptracehttp.WithEndpoint(endpoint), + otlptracehttp.WithEndpoint(u.Host), } if u.Scheme == "http" { opts = append(opts, otlptracehttp.WithInsecure()) } + if u.Path != "" && u.Path != "/" { + opts = append(opts, otlptracehttp.WithURLPath(u.Path)) + } exporter, err = otlptracehttp.New(setupCtx, opts...) default: return nil, fmt.Errorf("unsupported otel url scheme: %s", u.Scheme)