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
9 changes: 8 additions & 1 deletion internal/collector/otel_collector_plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -950,7 +950,14 @@ func (oc *Collector) setExporterProxyEnvVars(ctx context.Context) {

// setProxyEnvs sets the HTTP_PROXY and HTTPS_PROXY environment variables and logs the action.
func setProxyEnvs(ctx context.Context, proxyEnvURL, msg string) {
slog.DebugContext(ctx, msg, "url", proxyEnvURL)
logURL := proxyEnvURL
if u, err := url.Parse(proxyEnvURL); err == nil && u.User != nil {
u.User = nil
logURL = u.String()
}

slog.DebugContext(ctx, msg, "url", logURL)
Comment thread
Akshay2191 marked this conversation as resolved.
Dismissed

if setenvErr := os.Setenv("HTTPS_PROXY", proxyEnvURL); setenvErr != nil {
slog.ErrorContext(ctx, "Failed to set OTLP exporter proxy environment variables", "error", setenvErr)
}
Expand Down
Loading