kiwigrid / helm-charts

Helm charts for Kubernetes curated by Kiwigrid
https://kiwigrid.github.io
MIT License
186 stars 209 forks source link

[fluentd-elasticsearch] Fix jobLabel in ServiceMonitor #312

Closed jcpetruzza closed 4 years ago

jcpetruzza commented 4 years ago

What this PR does / why we need it:

The value of jobLabel in a ServiceMonitor defines the label of the scraped service whose value should be used as job_name by Prometheus. However, it looks like in the chart it was being used as if it was meant to be the actual value one wanted to use for the job. Because of this, scraped metrics would end up with, say, fluentd-elasticsearch-metrics (the name of the scraped Service) instead of fluentd-elasticsearch.

This is particularly tricky since it would interact badly with the provided PrometheusRules. For example, FluentdNodeDown, that would normally be triggered when there are no fluentd pods running, gets defined as up{job="fluentd-elasticsearch"} == 0, but because there are no samples generated for that job, it remains forever green!

We now use app.kubernetes.io/instance as jobLabel and make it overridable in the Values.yaml.

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]