From c20c839f2870df0be48a0f6c1580ab60c08c4a19 Mon Sep 17 00:00:00 2001 From: Pete Wall Date: Fri, 7 Feb 2025 13:21:12 -0600 Subject: [PATCH] Actually implement proxy URL for loki destinations Signed-off-by: Pete Wall --- charts/k8s-monitoring/docs/examples/proxies/alloy-logs.alloy | 1 + .../k8s-monitoring/docs/examples/proxies/alloy-receiver.alloy | 1 + .../k8s-monitoring/docs/examples/proxies/alloy-singleton.alloy | 1 + charts/k8s-monitoring/docs/examples/proxies/output.yaml | 3 +++ .../templates/destinations/_destination_loki.tpl | 3 +++ 5 files changed, 9 insertions(+) diff --git a/charts/k8s-monitoring/docs/examples/proxies/alloy-logs.alloy b/charts/k8s-monitoring/docs/examples/proxies/alloy-logs.alloy index bd8dc84f2..63d5d8331 100644 --- a/charts/k8s-monitoring/docs/examples/proxies/alloy-logs.alloy +++ b/charts/k8s-monitoring/docs/examples/proxies/alloy-logs.alloy @@ -6,6 +6,7 @@ otelcol.exporter.loki "loki" { loki.write "loki" { endpoint { url = "http://loki.loki.svc:3100/loki/api/v1/push" + proxy_url = "https://myproxy.default.svc:8080" tls_config { insecure_skip_verify = false } diff --git a/charts/k8s-monitoring/docs/examples/proxies/alloy-receiver.alloy b/charts/k8s-monitoring/docs/examples/proxies/alloy-receiver.alloy index 31630a998..2e055e5c9 100644 --- a/charts/k8s-monitoring/docs/examples/proxies/alloy-receiver.alloy +++ b/charts/k8s-monitoring/docs/examples/proxies/alloy-receiver.alloy @@ -55,6 +55,7 @@ otelcol.exporter.loki "loki" { loki.write "loki" { endpoint { url = "http://loki.loki.svc:3100/loki/api/v1/push" + proxy_url = "https://myproxy.default.svc:8080" tls_config { insecure_skip_verify = false } diff --git a/charts/k8s-monitoring/docs/examples/proxies/alloy-singleton.alloy b/charts/k8s-monitoring/docs/examples/proxies/alloy-singleton.alloy index 880acdd8f..24a06b6df 100644 --- a/charts/k8s-monitoring/docs/examples/proxies/alloy-singleton.alloy +++ b/charts/k8s-monitoring/docs/examples/proxies/alloy-singleton.alloy @@ -55,6 +55,7 @@ otelcol.exporter.loki "loki" { loki.write "loki" { endpoint { url = "http://loki.loki.svc:3100/loki/api/v1/push" + proxy_url = "https://myproxy.default.svc:8080" tls_config { insecure_skip_verify = false } diff --git a/charts/k8s-monitoring/docs/examples/proxies/output.yaml b/charts/k8s-monitoring/docs/examples/proxies/output.yaml index 4a5126ff5..1a15655dc 100644 --- a/charts/k8s-monitoring/docs/examples/proxies/output.yaml +++ b/charts/k8s-monitoring/docs/examples/proxies/output.yaml @@ -502,6 +502,7 @@ data: loki.write "loki" { endpoint { url = "http://loki.loki.svc:3100/loki/api/v1/push" + proxy_url = "https://myproxy.default.svc:8080" tls_config { insecure_skip_verify = false } @@ -660,6 +661,7 @@ data: loki.write "loki" { endpoint { url = "http://loki.loki.svc:3100/loki/api/v1/push" + proxy_url = "https://myproxy.default.svc:8080" tls_config { insecure_skip_verify = false } @@ -919,6 +921,7 @@ data: loki.write "loki" { endpoint { url = "http://loki.loki.svc:3100/loki/api/v1/push" + proxy_url = "https://myproxy.default.svc:8080" tls_config { insecure_skip_verify = false } diff --git a/charts/k8s-monitoring/templates/destinations/_destination_loki.tpl b/charts/k8s-monitoring/templates/destinations/_destination_loki.tpl index d9afe3d97..436cb1f08 100644 --- a/charts/k8s-monitoring/templates/destinations/_destination_loki.tpl +++ b/charts/k8s-monitoring/templates/destinations/_destination_loki.tpl @@ -32,6 +32,9 @@ loki.write {{ include "helper.alloy_name" .name | quote }} { {{- end }} } {{- end }} +{{- if .proxyURL }} + proxy_url = {{ .proxyURL | quote }} +{{- end }} {{- if eq (include "secrets.authType" .) "basic" }} basic_auth { username = {{ include "secrets.read" (dict "object" . "key" "auth.username" "nonsensitive" true) }}