Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions internal/tracing/config_resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func resolveEndpoint(cfg *config.TracingConfig) string {
signalPath = defaultSignalPath
}

logTracing.Printf("resolveEndpoint: endpoint=%q, signalPath=%q", endpoint, signalPath)

u, err := url.Parse(endpoint)
if err != nil {
// If unparseable, fall back to string append for best-effort.
Expand All @@ -40,6 +42,7 @@ func resolveEndpoint(cfg *config.TracingConfig) string {
if !strings.HasSuffix(normalized, signalPath) {
normalized += signalPath
}
logTracing.Printf("resolveEndpoint: URL parse failed, using string fallback: result=%q", normalized)
return normalized
}

Expand All @@ -50,12 +53,15 @@ func resolveEndpoint(cfg *config.TracingConfig) string {
} else {
u.Path = normalizedPath
}
return u.String()
resolved := u.String()
logTracing.Printf("resolveEndpoint: resolved=%q", resolved)
return resolved
}

// resolveServiceName returns the service name from config.
func resolveServiceName(cfg *config.TracingConfig) string {
if cfg != nil && cfg.ServiceName != "" {
logTracing.Printf("resolveServiceName: using configured service name: %q", cfg.ServiceName)
return cfg.ServiceName
}
return config.DefaultTracingServiceName
Expand Down Expand Up @@ -181,14 +187,16 @@ func resolveExtraEndpointConfigs(cfg *config.TracingConfig) []extraEndpointConfi
}

func resolveCommaSeparatedExtraEndpoints(raw, signalPath string) []extraEndpointConfig {
parts := strings.Split(raw, ",")
var endpoints []extraEndpointConfig
for _, ep := range strings.Split(raw, ",") {
for _, ep := range parts {
normalized := normalizeExtraEndpoint(ep, signalPath)
if normalized == "" {
continue
}
endpoints = append(endpoints, extraEndpointConfig{URL: normalized})
}
logTracing.Printf("resolveCommaSeparatedExtraEndpoints: parsed %d valid endpoint(s) from %d raw entries", len(endpoints), len(parts))
return endpoints
}

Expand Down
Loading