File: config.yml.dist

package info (click to toggle)
prometheus-sql-exporter 0.2.0.ds-6
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 492 kB
  • sloc: makefile: 47; sh: 31
file content (118 lines) | stat: -rw-r--r-- 3,284 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
---
jobs:
- name: "global"
  interval: '5m'
  connections:
  - 'postgres://postgres@localhost/postgres?sslmode=disable'
  queries:
  - name: "running_queries"
    help: "Number of running queries"
    labels:
      - "datname"
      - "usename"
    values:
      - "count"
    query:  |
            SELECT datname::text, usename::text, COUNT(*)::float AS count
            FROM pg_stat_activity GROUP BY datname, usename;
  - name: "db_sizes"
    help: "Database Sizes"
    labels:
      - "dbname"
    values:
      - "dbsize"
    query:  |
            SELECT datname::text AS dbname, pg_database_size(datname)::float AS dbsize
            FROM pg_database;
  - name: "replication_lag"
    help: "Replication Lag"
    labels:
      - "hostname"
    values:
      - "replication_lag"
    query:  |
            WITH lag AS ( 
            SELECT
            CASE
            WHEN pg_last_xlog_receive_location() = pg_last_xlog_replay_location() THEN 0
            ELSE EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp())
            END
            AS lag
            )
            SELECT
            split_part(inet_server_addr()::text, '/', 1) AS hostname,
            lag::float AS replication_lag
            FROM lag
- name: "mydb"
  interval: '5m'
  connections:
  - 'postgres://postgres@localhost/mydb?sslmode=disable'
  queries:
  - name: "pg_stat_user_tables"
    help: "Table stats"
    labels:
      - "schemaname"
      - "relname"
    values:
      - "seq_scan"
      - "seq_tup_read"
      - "idx_scan"
      - "idx_tup_fetch"
      - "n_tup_ins"
      - "n_tup_upd"
      - "n_tup_del"
      - "n_tup_hot_upd"
      - "n_live_tup"
      - "n_dead_tup"
      - "vacuum_count"
      - "autovacuum_count"
      - "analyze_count"
      - "autoanalyze_count"
    query:  |
            SELECT
              schemaname::text
            , relname::text
            , seq_scan::float
            , seq_tup_read::float
            , idx_scan::float
            , idx_tup_fetch::float
            , n_tup_ins::float
            , n_tup_upd::float
            , n_tup_del::float
            , n_tup_hot_upd::float
            , n_live_tup::float
            , n_dead_tup::float
            , vacuum_count::float
            , autovacuum_count::float
            , analyze_count::float
            , autoanalyze_count::float
            FROM pg_stat_user_tables;
  - name: "pg_statio_user_tables"
    help: "IO Stats"
    labels:
      - "schemaname"
      - "relname"
    values:
      - "heap_blks_read"
      - "heap_blks_hit"
      - "idx_blks_read"
      - "idx_blks_hit"
    query:  |
            SELECT
              schemaname::text
            , relname::text
            , heap_blks_read::float
            , heap_blks_hit::float
            , idx_blks_read::float
            , idx_blks_hit::float
            FROM pg_statio_user_tables;
queries:
  pg_statio_user_tables:    |
                            SELECT
                              schemaname::text
                            , relname::text
                            , heap_blks_read::float
                            , heap_blks_hit::float
                            , idx_blks_read::float
                            , idx_blks_hit::float
                            FROM pg_statio_user_tables;