-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy path2000-pg_heartbeat.yml
More file actions
25 lines (22 loc) · 1.06 KB
/
2000-pg_heartbeat.yml
File metadata and controls
25 lines (22 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#==============================================================#
# 2000 heartbeat
#==============================================================#
# this is a example of application monitoring and predicate queries
pg_heartbeat:
name: pg_heartbeat
desc: monitoring heartbeat in monitor.heartbeat table
predicate_queries:
- name: if heartbeat table exists
predicate_query: |
SELECT EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema = 'monitor' AND table_name = 'heartbeat');
query: |-
SELECT id AS cluster_name, extract(EPOCH FROM ts) AS ts, lsn, txid FROM monitor.heartbeat;
ttl: 10
min_version: 090100
tags: [ "dbname:postgres", "schema:monitor" ]
skip: true
metrics:
- cluster_name: { usage: LABEL ,description: "cluster_name param of this database cluster" }
- ts: { usage: GAUGE ,description: "unix timestamp of the heartbeat" }
- lsn: { usage: COUNTER ,description: "lsn of the heartbeat" }
- txid: { usage: GAUGE ,description: "txid of the heartbeat" }