Skip to content

Docker image contains invalid default pg_exporter.yml config file #91

@robinsummerhill

Description

@robinsummerhill

Starting pg_exporter using the minimal Docker command given in the docs does not work:

docker run -d \
  --name pg_exporter \
  -p 9630:9630 \
  -e PG_EXPORTER_URL="postgres://user:pass@host.docker.internal:5432/postgres" \
  pgsty/pg_exporter:latest

The following error is given:

time=2026-01-15T12:31:15.483Z level=INFO msg="retrieve target url  from PG_EXPORTER_URL"
time=2026-01-15T12:31:15.484Z level=INFO msg="fallback on default config path: /etc/pg_exporter.yml"
time=2026-01-15T12:31:15.496Z level=ERROR msg="fail creating pg_exporter: fail loading config file /etc/pg_exporter.yml: malformed config: yaml: unmarshal errors:\n  line 1320: cannot unmarshal !!map into float64"

The pg_exporter.yml copied to the docker image has this on line 1320:

  ttl: {{ ttl_norm }}

I assume it is supposed to be preprocessed to replace the value {{ ttl_norm }} before adding to the docker file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions