File: user_queries_ok.yaml

package info (click to toggle)
prometheus-postgres-exporter 0.8.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 456 kB
  • sloc: sh: 416; makefile: 19
file content (23 lines) | stat: -rw-r--r-- 1,203 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
pg_locks_mode:
  query: "WITH q_locks AS (select * from pg_locks where pid != pg_backend_pid() and database = (select oid from pg_database where datname = current_database())) SELECT (select current_database()) as datname,
  lockmodes AS tag_lockmode, coalesce((select count(*) FROM q_locks WHERE mode = lockmodes), 0) AS count FROM
  unnest('{AccessShareLock, ExclusiveLock, RowShareLock, RowExclusiveLock, ShareLock, ShareRowExclusiveLock,  AccessExclusiveLock, ShareUpdateExclusiveLock}'::text[]) lockmodes;"
  metrics:
    - datname:
        usage: "LABEL"
        description: "Database name"
    - tag_lockmode:
        usage: "LABEL"
        description: "Lock type"
    - count:
        usage: "GAUGE"
        description: "Number of lock"
pg_wal:
  query: "select current_database() as datname, case when pg_is_in_recovery() = false then pg_xlog_location_diff(pg_current_xlog_location(), '0/0')::int8 else pg_xlog_location_diff(pg_last_xlog_replay_location(), '0/0')::int8 end as xlog_location_b;"
  metrics:
    - datname:
        usage: "LABEL"
        description: "Database name"
    - xlog_location_b:
        usage: "COUNTER"
        description: "current transaction log write location"