From 632d864934a45dca93bc6daf807c4e3cd0107937 Mon Sep 17 00:00:00 2001 From: Chris Werner Rau Date: Tue, 14 May 2024 10:48:32 +0200 Subject: [PATCH] fix(common/telemetry): checking of endpoint add missing `http://` if necessary --- charts/common/templates/_telemetry.tpl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/charts/common/templates/_telemetry.tpl b/charts/common/templates/_telemetry.tpl index 682dd38c1..fcdd24797 100644 --- a/charts/common/templates/_telemetry.tpl +++ b/charts/common/templates/_telemetry.tpl @@ -44,9 +44,12 @@ {{- /* no LOGS for now, loki is running anyways, so we'd even have to deduplicate the logs somehow */ -}} {{- range $signal := list "TRACES" -}} - {{- if not (hasPrefix "http" $endpoint)}} + {{- if not (hasPrefix "https://" $endpoint) -}} {{- $env = set $env (printf "OTEL_EXPORTER_OTLP_%s_INSECURE" $signal) $insecure -}} {{- end -}} + {{- if not (mustRegexMatch "https?://" $endpoint) -}} + {{- $endpoint = printf "http://%s" $endpoint -}} + {{- end -}} {{- if $serviceProtocol -}} {{- $env = set $env (printf "OTEL_EXPORTER_OTLP_%s_PROTOCOL" $signal) $serviceProtocol -}} {{- end -}}