Skip to content

Scrape multiple postgres datasources by postgresql exporter #267

@JaroVojtek

Description

@JaroVojtek

Hello
We are deploying postgresql-exporter into Kubernetes using helm chart stable/prometheus-postgres-exporter.

In values.yaml helm-chart is section about datasource configuration, which should be configured to tell exporter, which postgresql database endpoint should be scrapped.

config:
  datasource:
    host: <ip_address>
    user: <user>
    password: <password>
    port: "5432"
    database: ''
    sslmode: disable

Inserted values are used for creating secret in Kubernetes, where data section contains encoded postgresql connection string into DB, (e.g. decoded) :

kind: Secret
metadata:
  name: RELEASE-NAME-prometheus-postgres-exporter
  labels:
    app: prometheus-postgres-exporter
    chart: prometheus-postgres-exporter-0.4.0
    heritage: Tiller
    release: RELEASE-NAME
type: Opaque
data:
  data_source_name: "postgresql://<user>:<password>@<ip_address>:5432/?sslmode=disable"

Is there an option to configure more than one datasources in values.yaml file to tell exporter to scrape 2 database endpoint for example:

config:
  datasource:
    host: [<ip_address1>, <ip_address2>]
    user: <user>
    password: <password>
    port: "5432"
    database: ''
    sslmode: disable

Or make content of data_source_name in different format, e.g.:

data:
  data_source_name: "user=<user>, password=<password>, host=<ip_address1>, host=<ip_address2>, sslmode=disable, port=5432"

Did somebody have this kind of use-case? Is there a solution for doing this?

Thank you

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions