[stable/prometheus-postgres-exporter] Add feature 'auto-discover-databases' (#17826)

Ref: https://github.com/wrouesnel/postgres_exporter#automatically-discover-databases

Signed-off-by: Frederic Hemberger <mail@frederic-hemberger.de>
This commit is contained in:
Frederic Hemberger
2019-10-10 23:59:58 -07:00
committed by Kubernetes Prow Robot
parent a7d50ba9f3
commit c1f533f7da
4 changed files with 13 additions and 2 deletions
@@ -2,7 +2,7 @@ apiVersion: v1
appVersion: "0.5.1"
description: A Helm chart for prometheus postgres-exporter
name: prometheus-postgres-exporter
version: 1.0.0
version: 1.1.0
home: https://github.com/wrouesnel/postgres_exporter
sources:
- https://github.com/wrouesnel/postgres_exporter
@@ -57,6 +57,8 @@ The following table lists the configurable parameters of the postgres Exporter c
| `config.datasource` | Postgresql datasource configuration | see [values.yaml](values.yaml) |
| `config.queries` | SQL queries that the exporter will run | [postgres exporter defaults](https://github.com/wrouesnel/postgres_exporter/blob/master/queries.yaml) |
| `config.disableDefaultMetrics` | Specifies whether to use only metrics from `queries.yaml`| `false` |
| `config.autoDiscoverDatabases` | Specifies whether to autodiscover all databases | `false` |
| `config.excludeDatabases` | When autodiscover is enabled, list databases to exclude| `[]` |
| `rbac.create` | Specifies whether RBAC resources should be created.| `true` |
| `rbac.pspEnabled` | Specifies whether a PodSecurityPolicy should be created.| `true` |
| `serviceAccount.create` | Specifies whether a service account should be created.| `true` |
@@ -28,7 +28,7 @@ spec:
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.annotations }}
{{ toYaml .Values.annotations | indent 8 }}
{{- end}}
{{- end }}
spec:
serviceAccountName: {{ template "prometheus-postgres-exporter.serviceAccountName" . }}
containers:
@@ -38,6 +38,13 @@ spec:
{{- if .Values.config.disableDefaultMetrics }}
- "--disable-default-metrics"
{{- end }}
{{- if .Values.config.autoDiscoverDatabases }}
- "--auto-discover-databases"
{{- if .Values.config.excludeDatabases }}
- "--exclude-databases"
- {{ .Values.config.excludeDatabases | join "," }}
{{- end }}
{{- end }}
env:
- name: DATA_SOURCE_URI
value: {{ template "prometheus-postgres-exporter.data_source_uri" . }}
@@ -75,6 +75,8 @@ config:
database: ''
sslmode: disable
disableDefaultMetrics: false
autoDiscoverDatabases: false
excludeDatabases: []
# this are the defaults queries that the exporter will run, extracted from: https://github.com/wrouesnel/postgres_exporter/blob/master/queries.yaml
queries: |-
pg_replication: