Skip to content

Commit

Permalink
fixing PR review suggestions
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Chabin <[email protected]>
  • Loading branch information
adamchabin committed Oct 16, 2023
1 parent 748d771 commit ae3c207
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
6 changes: 6 additions & 0 deletions charts/prometheus/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -234,3 +234,9 @@ Define prometheus.server.remoteRead producing a list of remoteRead configuration
{{ toYaml $remoteReads }}
{{- end -}}

{{/*
Define prometheus.server.global.externalLabels producing a list of externalLabels
*/}}
{{- define "prometheus.server.global.externalLabels" -}}
{{ toYaml .Values.server.global.externalLabels }}
{{- end -}}
5 changes: 3 additions & 2 deletions charts/prometheus/templates/cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@ data:
{{- if eq $key "prometheus.yml" }}
global:
{{ $root.Values.server.global | toYaml | trimSuffix "\n" | indent 6 }}
{{- with $root.Values.server.externalLabels }}
external_labels: {{ toYaml . | nindent 8 }}
{{- if $root.Values.server.global.externalLabels }}
external_labels:
{{- include "prometheus.server.global.externalLabels" $root | nindent 8 }}
{{- end }}
{{- if $root.Values.server.remoteWrite }}
remote_write:
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ server:
## How frequently to evaluate rules
##
evaluation_interval: 1m
## https://prometheus.io/docs/prometheus/latest/configuration/configuration/
##
externalLabels: {}
## https://prometheus.io/docs/prometheus/latest/configuration/configuration/#remote_write
##
remoteWrite: []
Expand Down

0 comments on commit ae3c207

Please sign in to comment.