prometheus-community / prometheus-community/postgres_exporter

statio_user_tables shows only postgres database schemas

Open
#984 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
3.6k
Forks
835
Avg merge
2d 4h
Merged PRs (30d)
10

Description

What did you do?
installed and configured postgres_exporter. aside postgres database, there is another one, let's call it userdb
What did you expect to see?
metrics like pg_statio_user_tables_tidx_blocks_read for tables in database userdb
What did you see instead? Under which circumstances?
I see only metrics for schemas in postgres database. looks like it doesn't have access by default there? to see pg_stat_user_tables for schemas in userdb I need to connect to it first, but you say in readme that connection string should consist of only postgres database

Environment

  • System information:
    Linux 3.10.0-1160.6.1.el7.x86_64 x86_64

  • 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:
    PG_EXPORTER_DISABLE_SETTINGS_METRICS=false
    DATA_SOURCE_URI=:7430/postgres?sslmode=disable&host=/tmp
    DATA_SOURCE_USER=postgres
    --web.listen-address=0.0.0.0:9187 --collector.stat_statements --collector.statio_user_indexes
    --collector.long_running_transactions --collector.database_wraparound
    --collector.stat_activity_autovacuum --log.level=debug

  • PostgreSQL version:
    postgresql 11

  • Logs:
    no errors
    collector.go:206 level=debug msg="collector succeeded" name=statio_user_tables duration_seconds=4.023973512

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with collector.go and the statio_user_tables collector, then review the README connection-string guidance. Reproduce the behavior on PostgreSQL 11 with the postgres and userdb databases; done means metrics for userdb are exposed or the supported limitation is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, postgresql
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.