Skip to content

Commit c94b613

Browse files
authored
Add missing DB size metric (#157)
* Add missing dashboard metrics * cache query for 30 seconds * Cast bool to string * Will have to handle pg_replication at different time
1 parent cd206a1 commit c94b613

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cmd/start/main.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ func main() {
7474
"DATA_SOURCE_PASS": node.SUCredentials.Password,
7575
"PG_EXPORTER_EXCLUDE_DATABASE": "template0,template1",
7676
"PG_EXPORTER_AUTO_DISCOVER_DATABASES": "true",
77+
"PG_EXPORTER_EXTEND_QUERY_PATH": "/fly/queries.yaml",
7778
}
7879
svisor.AddProcess("exporter", "postgres_exporter --log.level=warn ",
7980
supervisor.WithEnv(exporterEnv),

config/queries.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,18 @@ pg_database:
99
- size_bytes:
1010
usage: "GAUGE"
1111
description: "Disk space used by the database"
12+
13+
# pg_replication:
14+
# query: "SELECT slot_name, CAST(active AS TEXT), pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) AS lag FROM pg_replication_slots"
15+
# master: true
16+
# cache_seconds: 30
17+
# metrics:
18+
# - slot_name:
19+
# usage: "LABEL"
20+
# description: "Name of replication slot"
21+
# # - active:
22+
# # usage: "LABEL"
23+
# # description: "Whether the replication slot is active"
24+
# - lag:
25+
# usage: "GAUGE"
26+
# description: "Replication lag in bytes"

0 commit comments

Comments
 (0)