Skip to content

Allow caching of query results #210

@SamSaffron

Description

@SamSaffron

Getting pg database size is very expensive, especially if we need to do this across hundreds of dbs.

I would like an optional cache property per query that allows us to "remember" the last execution of the query for N seconds... Eg:

pg_database:
  query: " SELECT pg_database.datname, pg_database_size(pg_database.datname) as size FROM pg_database" 
  cache: 3600
  metrics:
    - datname:
        usage: "LABEL"
        description: "Name of the database"
    - size:
        usage: "GAUGE"
        description: "Disk space used by the database"

Is there any objection to adding such an optional attribute.

Currently we have no way of reporting DB size cause if we report it we hammer our DBs into oblivion

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