Skip to content

"target is required" when trying to fetch metrics #1050

Closed
@mapausch

Description

@mapausch

What did you do?

  • created a monitoring-user on my PostgreSQL db and granted roles pg_monitor, pg_read_all_stats
  • started container according to the docs:

user@grafan-host$ podman run --net=host -e DATA_SOURCE_NAME='postgresql://monitoring-user:monitoring-password@pgsql-host:5432/postgres?sslmode=disable' quay.io/prometheuscommunity/postgres-exporter ts=2024-06-24T14:11:32.258Z caller=main.go:86 level=warn msg="Error loading config" err="Error opening config file \"postgres_exporter.yml\": open postgres_exporter.yml: no such file or directory" ts=2024-06-24T14:11:32.258Z caller=proc.go:267 msg="Excluded databases" databases=[] ts=2024-06-24T14:11:32.259Z caller=tls_config.go:274 level=info msg="Listening on" address=[::]:9187 ts=2024-06-24T14:11:32.259Z caller=tls_config.go:277 level=info msg="TLS is disabled." http2=false address=[::]:9187

  • tried to fetch metrics with curl
user@grafan-host$ curl http://localhost:9187/probe
target is required

What did you expect to see?
the metrics that postgresql_exporter fetches from database

What did you see instead? Under which circumstances?

  • "target is required" (see above output of curl)
  • postgres_exporter doesn't even try to connect to the database on postgresql-host

Environment

  • System information:
$ uname -srm
Linux 5.15.0-204.147.6.2.el9uek.x86_64 x86_64
  • postgres_exporter version:
user@grafan-host$ podman exec -it container-name /bin/sh
/ $ postgres_exporter --version
postgres_exporter, version 0.15.0 (branch: HEAD, revision: 68c176b8833b7580bf847cecf60f8e0ad5923f9a)
  build user:       root@88f74f2c2888
  build date:       20231027-14:38:56
  go version:       go1.21.3
  platform:         linux/amd64
  tags:             unknown

  • postgres_exporter flags:
N/A
  • PostgreSQL version:

    16

  • Logs:

insert logs relevant to the issue here

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