prometheus-formula icon indicating copy to clipboard operation
prometheus-formula copied to clipboard

[BUG] Postgres Environment File (Debian)

Open B1ue-W01f opened this issue 3 years ago • 1 comments

Your setup

Formula commit hash / release tag

n/a

Versions reports (master & minion)

n/a

Pillar / config used

prometheus:
  wanted:
    component:
      # List components (ie, exporters) using underscores and
      # removing the 'prometheus' prefix
      - postgres_exporter
  pkg:
    component:
      postgres_exporter:
        environ_file: /etc/default/prometheus-postgres-exporter
        environ:
          environ_arg_name: ARGS
          args:
            DATA_SOURCE_NAME: exporter:[email protected]:5432/?sslmode=disable

Bug details

Describe the bug

On debian at least, the postgres exporter requires no ARGS header at the start of the environment variables file.

Steps to reproduce the bug

n/a

Expected behaviour

The formula should implement the exporter and allow config of the environment variables.

Attempts to fix the bug

Enclosing the variables in "" appears to be acceptable but the ARGS= needs to be removed, potential fix would be to have the name default to blank and include the '=' if one is provided. Resulting in a file such as below if none give:

"DATA_SOURCE_NAME: exporter:[email protected]:5432/?sslmode=disable" 

B1ue-W01f avatar Jun 29 '21 14:06 B1ue-W01f