diff --git a/charts/prometheus-postgres-exporter/Chart.yaml b/charts/prometheus-postgres-exporter/Chart.yaml index cd9fb8292052..ad1232ab68d2 100644 --- a/charts/prometheus-postgres-exporter/Chart.yaml +++ b/charts/prometheus-postgres-exporter/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: "v0.16.0" description: A Helm chart for prometheus postgres-exporter name: prometheus-postgres-exporter -version: 6.7.1 +version: 6.8.0 home: https://github.com/prometheus-community/postgres_exporter sources: - https://github.com/prometheus-community/postgres_exporter diff --git a/charts/prometheus-postgres-exporter/templates/servicemonitor.yaml b/charts/prometheus-postgres-exporter/templates/servicemonitor.yaml index 9dccf089324f..6d7ba837cdeb 100644 --- a/charts/prometheus-postgres-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-postgres-exporter/templates/servicemonitor.yaml @@ -47,7 +47,11 @@ spec: {{- end }} params: target: + {{- if .databaseName }} + - {{ .endpoint }}:{{ .port | default 5432 }}/{{ .databaseName | default "" }} + {{- else }} - {{ .endpoint }}:{{ .port | default 5432 }} + {{- end }} {{- if $.Values.serviceMonitor.multipleTarget.sharedAuthModule.enabled }} auth_module: - {{ $.Values.serviceMonitor.multipleTarget.sharedAuthModule.name }} diff --git a/charts/prometheus-postgres-exporter/values.yaml b/charts/prometheus-postgres-exporter/values.yaml index feb6a9aefff1..db71653907fd 100644 --- a/charts/prometheus-postgres-exporter/values.yaml +++ b/charts/prometheus-postgres-exporter/values.yaml @@ -65,6 +65,7 @@ serviceMonitor: # - endpoint: pg01.local # name: pg01 (there needs to exist an authModule with key "client.pg01" if not using sharedAuthModule) # port: default 5432 + # databaseName: default '' (Set the database name to connect to) prometheusRule: enabled: false