Skip to content

Commit fbaad01

Browse files
authored
Set PG_EXPORTER_AUTO_DISCOVERY to true for the pg_exporter (#23)
* Enable the AUTO_DISCOVERY on the pg_exporter * Fix the env var that should be text * Make the autodiscovery optional
1 parent 15731a2 commit fbaad01

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

charts/db-instances/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ apiVersion: v1
22
appVersion: "1.0"
33
description: Database Instances for db operator
44
name: db-instances
5-
version: 2.0.0
5+
version: 2.1.0

charts/db-instances/ci/ci-test-service-monitor-values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ dbinstances:
44
enabled: true
55
engine: postgres
66
monitoring:
7+
autodiscovery: true
78
enabled: true
89
generic:
910
host: postgres-instance-postgresql.postgres

charts/db-instances/templates/postgres_exporter.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ spec:
4444
value: /run/cm/queries/queries.yaml
4545
- name: PG_EXPORTER_CONSTANT_LABELS
4646
value: dbinstance={{ $name }}
47+
{{- if $value.monitoring.autodiscovery }}
48+
- name: PG_EXPORTER_AUTO_DISCOVERY
49+
value: "true"
50+
{{- end }}
4751
image: {{ $exporter.image }}
4852
imagePullPolicy: Always
4953
name: exporter

0 commit comments

Comments
 (0)