fix: update OpenTelemetry configuration template to use index for environment variables

This commit is contained in:
Simon Larsen
2025-01-23 21:31:58 +00:00
parent ea38e2621f
commit eb9e20dad5

View File

@@ -40,11 +40,11 @@ exporters:
service:
telemetry:
{{ if or (not .Env.OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT) (eq .Env.DISABLE_TELEMETRY "true") }}
{{ if or (not (index .Env "OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT")) (eq .Env.DISABLE_TELEMETRY "true") }}
logs:
level: "debug"
{{ end }}
{{ if and (ne .Env.DISABLE_TELEMETRY "true") .Env.OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT }}
{{ if and (ne .Env.DISABLE_TELEMETRY "true") (index .Env "OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT") }}
logs:
level: "debug"
metrics: