diff --git a/logs/otel.go b/logs/otel.go index 79213a2..80abce1 100644 --- a/logs/otel.go +++ b/logs/otel.go @@ -37,10 +37,11 @@ func Init(machineId, hostname, version string) { otlplogshttp.WithEndpoint(endpointUrl.Host), otlplogshttp.WithURLPath(path), otlplogshttp.WithHeaders(common.AuthHeaders()), - otlplogshttp.WithTLSClientConfig(&tls.Config{InsecureSkipVerify: *flags.InsecureSkipVerify}), } if endpointUrl.Scheme != "https" { opts = append(opts, otlplogshttp.WithInsecure()) + } else { + opts = append(opts, otlplogshttp.WithTLSClientConfig(&tls.Config{InsecureSkipVerify: *flags.InsecureSkipVerify})) } client := otlplogshttp.NewClient(opts...) exporter, _ := otlplogs.NewExporter(context.Background(), otlplogs.WithClient(client)) diff --git a/tracing/tracing.go b/tracing/tracing.go index ef59952..f95237a 100644 --- a/tracing/tracing.go +++ b/tracing/tracing.go @@ -66,10 +66,11 @@ func Init(machineId, hostname, version string) { otlptracehttp.WithEndpoint(endpointUrl.Host), otlptracehttp.WithURLPath(path), otlptracehttp.WithHeaders(common.AuthHeaders()), - otlptracehttp.WithTLSClientConfig(&tls.Config{InsecureSkipVerify: *flags.InsecureSkipVerify}), } if endpointUrl.Scheme != "https" { opts = append(opts, otlptracehttp.WithInsecure()) + } else { + opts = append(opts, otlptracehttp.WithTLSClientConfig(&tls.Config{InsecureSkipVerify: *flags.InsecureSkipVerify})) } client := otlptracehttp.NewClient(opts...) exporter, err := otlptrace.New(context.Background(), client)