Skip to content

Support reading credentials from file #1288

Description

@guillemc23

I'm wondering if, similar to other exporters, the credentials can be passed onto the exporter using files.

For example, in the PostgreSQL exporter, the credentials can be automatically read from a file:
https://github.com/prometheus-community/postgres_exporter#environment-variables

Ideally, this would allow setting the exporter in a monitoring stack like this, using Docker secrets without having to expose the credentials:

    command:
      - --mongodb.uri=mongodb://${MONGO_IP}:${MONGO_PORT}/?authSource=admin
      - --collect-all
    environment:
      MONGO_IP: ...
      MONGO_PORT: ...
      MONGODB_USER_FILE: /run/secrets/mongo_usr
      MONGODB_PASSWORD_FILE: /run/secrets/mongo_pwd
    secrets:
      - mongo_usr
      - mongo_pwd

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions