From 5118cfbf0b143c5998449c43c6796d09b19281bf Mon Sep 17 00:00:00 2001 From: Marcel Weinberg Date: Tue, 7 May 2024 20:57:44 +0200 Subject: [PATCH] fix(helm) Add capability to ignore the gateway service by the serviceMonitor --- production/helm/loki/templates/gateway/service-gateway.yaml | 3 +++ production/helm/loki/values.yaml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/production/helm/loki/templates/gateway/service-gateway.yaml b/production/helm/loki/templates/gateway/service-gateway.yaml index 8c710263d7d2..4854e649d2e6 100644 --- a/production/helm/loki/templates/gateway/service-gateway.yaml +++ b/production/helm/loki/templates/gateway/service-gateway.yaml @@ -12,6 +12,9 @@ metadata: {{- with .Values.gateway.service.labels }} {{- toYaml . | nindent 4}} {{- end }} + {{- if .Values.gateway.excludeFromServiceMonitor }} + prometheus.io/scrape: "false" + {{- end }} annotations: {{- with .Values.loki.serviceAnnotations }} {{- toYaml . | nindent 4}} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 36d42cddc09c..5b1258235867 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -975,6 +975,9 @@ gateway: annotations: {} # -- Labels for gateway service labels: {} + # -- Adds the label prometheus.io/service-monitor: "false" to the gateway service so that it's excluded from the loki serviceMonitor + # The nginx does not export metrics per default and would be reported as down if monitoring.serviceMonitor.enabled is true. + excludeFromServiceMonitor: false # Gateway ingress configuration ingress: # -- Specifies whether an ingress for the gateway should be created