Expose metrics for all available databases on a PMM monitored PostgreSQL server

Description

User story:
When I monitoring PG server I need to get metrics about all databases on the server so that I can better understand the performance impact created by individual databases

UI/UX:
N/A

Acceptance criteria

  • We have metrics collected regarding all databases accessible with the passed user

  • Current dashboards working as expected

Out of scope:

  • Any specific dashboards will be developed later separately

  • Changes in instructions to create a user permissions

Suggested implementation:
TBD

How to test:

  • check that exporter has next flags:
    --auto-discover-databases
    --exclude-databases=template0,template1,postgres

  • place file

  • with a custom queries into /usr/local/percona/pmm2/collectors/custom-queries/postgresql/medium-resolution/ folder

  • restart exporter

  • check that metric pg_stat_user_tables_analyze_count collected for all existed databases (except template0,template1,postgres)

Details:
TBD

How to test

None

How to document

None

Attachments

10

Smart Checklist

Activity

Show:

Nurlan Moldomurov March 25, 2021 at 9:25 AM

, merged

Vadim Yalovets March 25, 2021 at 9:14 AM

Vadim Yalovets March 17, 2021 at 2:37 PM

No changes in documentation are required. It's already suggested to use a user with superuser level access.

Vadim Yalovets March 16, 2021 at 5:20 PM

server docker - perconalab/pmm-server-fb:PR-1612-1eb211c
client docker - perconalab/pmm-client-fb:PR-1612-1eb211c
client - https://s3.us-east-2.amazonaws.com/pmm-build-cache/PR-BUILDS/pmm2-client/pmm2-client-PR-1612-1eb211c.tar.gz

Vadim Yalovets January 22, 2021 at 1:01 PM
Edited


Our fork of postgresql_exporter has got flag --auto-discover-databases
So I have prepared a FB with enabled this flag by default.
perconalab/pmm-server-fb:PR-1420-dd243e0

Also a sample of dashboard "PostgreSQL Tuple Statistics" has included.

So the flag is working but next issues are discovered:

  1. It's not possible to create a new database on a monitored instance

  2. pmm-agent logs are overloaded with warnings
    e.g.

3. New metrics are collected with empty datname parameter. So it's required to modify formulas in order to hide such metrics.

It looks like we have to sync our fork to the latest upstream version in order to use flag "--exclude-databases="" So we could exclude template databases from scraping.

So I have set the ticket related to fork sync as a blocker for this ticket.

Done

Details

Assignee

Reporter

Priority

Components

Needs QA

Yes

Fix versions

Story Points

Sprint

Reviewer

Smart Checklist

Created January 18, 2021 at 3:27 PM
Updated July 18, 2024 at 2:23 PM
Resolved March 25, 2021 at 11:36 AM