Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgreslet monitoring enhancements #59

Open
TLINDEN opened this issue Feb 7, 2023 · 0 comments
Open

Postgreslet monitoring enhancements #59

TLINDEN opened this issue Feb 7, 2023 · 0 comments

Comments

@TLINDEN
Copy link
Collaborator

TLINDEN commented Feb 7, 2023

Add the following new monitoring features to the postgreslet helmchart:

Slow queries global stats

Metric code see #56

User table size stats

  query: "SELECT current_database() datname, pgn.nspname schemaname, pgc.relname, CAST(pgc.reltuples AS BIGINT) table_rows, pg_total_relation_size(pgc.oid) disk_usage_table_bytes, pg_indexes_size(pgc.oid) disk_usage_index_bytes, COALESCE(pg_total_relation_size(pgc.reltoastrelid), 0) disk_usage_toast_bytes FROM pg_class pgc JOIN pg_namespace pgn ON pgc.relnamespace = pgn.oid"
  metrics:
    - datname:
        usage: "LABEL"
        description: "Name of the database that this table is in"
    - schemaname:
        usage: "LABEL"
        description: "Name of the schema that this table is in"
    - relname:
        usage: "LABEL"
        description: "Name of the table, index, view, etc."
    - table_rows:
        usage: "GAUGE"
        decription: "Number of rows in the table. This is only an estimate used by the planner. It is updated by VACUUM, ANALYZE, and a few DDL commands such as CREATE INDEX"
    - disk_usage_table_bytes:
        usage: "GAUGE"
        description: "Total disk space used by the specified table, including all indexes and TOAST data"
    - disk_usage_index_bytes:
        usage: "GAUGE"
        description: "Total disk space used by indexes attached to the specified table"
    - disk_usage_toast_bytes:
        usage: "GAUGE"
        description: "Total disk space used by TOAST data attached to the specified table"

Enable the possibility to turn on postgres exporter auto database discovery

The following environment variables need to be added:

PG_EXPORTER_AUTO_DISCOVER_DATABASES
PG_EXPORTER_EXCLUDE_DATABASES
PG_EXPORTER_INCLUDE_DATABASES
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant