diff --git a/docs/values.md b/docs/values.md index 7e265bd7afc2b879747146c2b4416f027c651245..3d7038258468e7b687bfe5cb53917a14dd9f28cd 100644 --- a/docs/values.md +++ b/docs/values.md @@ -56,7 +56,7 @@ This file contains the markdown version of the default values that this chart ta | metrics.prometheus.operator | object | Resources configuration. See `values.yaml`. | specific configuration for the prometheus operator | | metrics.prometheus.operator.nodeSelector | hash | `"nil"` | prometheus operator node selectors | | metrics.prometheus.server.nodeSelector | hash | `"nil"` | prometheus server node selectors | -| metrics.prometheus.server.extraLabelsForMetrics | list | `[]` | set of static labels and values to add to all the metrics gathered by the in-cluster prometheus when exported to central monitoring | +| metrics.prometheus.server.extraLabelsForMetrics | hash | `{}` | set of static labels and values to add to all the metrics gathered by the in-cluster prometheus when exported to central monitoring | | metrics.prometheus.server.remoteWrite | object | `{}` | remote write prometheus configuration | | metrics.prometheus.server.resources.limits.cpu | string | `"500m"` | | | metrics.prometheus.server.resources.limits.memory | string | `"5Gi"` | | @@ -72,4 +72,4 @@ This file contains the markdown version of the default values that this chart ta | tenant.name | string | `"nil"` | username used for authenitcating in the MONIT infrastructure | | tenant.password | string | `"nil"` | password (plain) used for authenitcating in the MONIT infrastructure | ----------------------------------------------- \ No newline at end of file +---------------------------------------------- diff --git a/templates/prometheus/prometheus.yaml b/templates/prometheus/prometheus.yaml index 9bc348b2f61f799beeabdacfa70009f47653af67..83cd97f384fbe058216eec94ed18653b17f18549 100644 --- a/templates/prometheus/prometheus.yaml +++ b/templates/prometheus/prometheus.yaml @@ -12,6 +12,9 @@ spec: retention: {{ .Values.metrics.prometheus.server.retention }} externalLabels: k8s_cluster_name: {{ .Values.kubernetes.clusterName }} + {{- with .Values.metrics.prometheus.server.extraLabelsForMetrics }} + {{- toYaml . | nindent 4 }} + {{- end }} nodeSelector: {{- .Values.metrics.prometheus.server.nodeSelector | default .Values.metrics.defaultNodeSelector | toYaml | nindent 4 }} serviceAccountName: it-monit-metrics-collector-prometheus diff --git a/values.yaml b/values.yaml index e9dc25b2451962da8cb915f2627bcf569631b32b..a7d05c06cb484f7b0250bf65cef8d5311f191abf 100644 --- a/values.yaml +++ b/values.yaml @@ -88,7 +88,7 @@ metrics: # -- interval during which local cluster prometheus will store metrics retention: "24h" # -- set of static labels and values to add to all the metrics gathered by the in-cluster prometheus when exported to central monitoring - extraLabelsForMetrics: [] + extraLabelsForMetrics: {} # -- remote write prometheus configuration remoteWrite: {} # endpoint: "https://monit-prom-mom.cern.ch:9090/api/v1/write"