Skip to content

Support environment variables for credentials #132

Open
@jsirianni

Description

@jsirianni

Would it be possible to support environment variables for the exporter's configuration?

I intend to use this exporter with Kubernetes, right now I need to do something like this:

        - name: metrics-exporter
          image: prometheuscommunity/pgbouncer-exporter:v0.7.0
          args:
            - --pgBouncer.connectionString=postgres://pgbouncer:pgbouncer@localhost:5432/pgbouncer
            - --web.listen-address=:9127

It is more ideal to use environment variables as they can be derived from pre configured secrets.

        - name: metrics-exporter
          image: prometheuscommunity/pgbouncer-exporter:v0.7.0
          args:
            - --web.listen-address=:9127
          env:
            - name: PGBOUNCER_CONNECTION_STRING
              valueFrom:
                secretKeyRef:
                  name: pgbouncer-connection-string

This way, the configuration can be safely committed to a Git repo, and the secret can be managed by existing secret management tools within the K8s ecosystem.

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