diff --git a/cmd/start/main.go b/cmd/start/main.go index 172e1f71..7836506b 100644 --- a/cmd/start/main.go +++ b/cmd/start/main.go @@ -74,6 +74,7 @@ func main() { "DATA_SOURCE_PASS": node.SUCredentials.Password, "PG_EXPORTER_EXCLUDE_DATABASE": "template0,template1", "PG_EXPORTER_AUTO_DISCOVER_DATABASES": "true", + "PG_EXPORTER_EXTEND_QUERY_PATH": "/fly/queries.yaml", } svisor.AddProcess("exporter", "postgres_exporter --log.level=warn ", supervisor.WithEnv(exporterEnv), diff --git a/config/queries.yaml b/config/queries.yaml index d42ab213..ec7882ba 100644 --- a/config/queries.yaml +++ b/config/queries.yaml @@ -9,3 +9,18 @@ pg_database: - size_bytes: usage: "GAUGE" description: "Disk space used by the database" + +# pg_replication: +# query: "SELECT slot_name, CAST(active AS TEXT), pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn) AS lag FROM pg_replication_slots" +# master: true +# cache_seconds: 30 +# metrics: +# - slot_name: +# usage: "LABEL" +# description: "Name of replication slot" +# # - active: +# # usage: "LABEL" +# # description: "Whether the replication slot is active" +# - lag: +# usage: "GAUGE" +# description: "Replication lag in bytes"