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