Skip to content

Commit

Permalink
Do not set the namespaces list for ServiceMonitors, PodMonitors, or P…
Browse files Browse the repository at this point in the history
…robes if the list is empty. (#393)

Should cause no functional difference, but it's clearer this way.

Signed-off-by: Pete Wall <pete.wall@grafana.com>
  • Loading branch information
petewall authored Mar 4, 2024
1 parent af885fd commit 7320c89
Show file tree
Hide file tree
Showing 39 changed files with 6 additions and 171 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{{ define "agent.config.pod_monitors" }}
// Prometheus Operator PodMonitor objects
prometheus.operator.podmonitors "pod_monitors" {
{{- if .Values.metrics.podMonitors.namespaces }}
namespaces = {{ .Values.metrics.podMonitors.namespaces | toJson }}
{{- end }}
forward_to = [prometheus.relabel.podmonitors.receiver]
{{- if .Values.metrics.podMonitors.selector }}
selector {
Expand Down Expand Up @@ -29,7 +31,9 @@ prometheus.relabel "podmonitors" {
{{ define "agent.config.probes" }}
// Prometheus Operator Probe objects
prometheus.operator.probes "probes" {
{{- if .Values.metrics.probes.namespaces }}
namespaces = {{ .Values.metrics.probes.namespaces | toJson }}
{{- end }}
forward_to = [prometheus.relabel.probes.receiver]
{{- if .Values.metrics.probes.selector }}
selector {
Expand Down Expand Up @@ -58,7 +62,9 @@ prometheus.relabel "probes" {
{{ define "agent.config.service_monitors" }}
// Prometheus Operator ServiceMonitor objects
prometheus.operator.servicemonitors "service_monitors" {
{{- if .Values.metrics.serviceMonitors.namespaces }}
namespaces = {{ .Values.metrics.serviceMonitors.namespaces | toJson }}
{{- end }}
forward_to = [prometheus.relabel.servicemonitors.receiver]
{{- if .Values.metrics.serviceMonitors.selector }}
selector {
Expand Down
3 changes: 0 additions & 3 deletions examples/cluster-with-pvc/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions examples/cluster-with-pvc/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/control-plane-metrics/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions examples/control-plane-metrics/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/custom-config/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions examples/custom-config/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/custom-metrics-tuning/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions examples/custom-metrics-tuning/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions examples/default-values/metrics.river

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions examples/default-values/output.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7320c89

Please sign in to comment.