@@ -391,9 +391,10 @@ def get_list_chunks(lst, n):
391
391
pg_stat_replication.client_addr,
392
392
pg_stat_replication_slot.slot_name,
393
393
pg_stat_replication_slot.slot_type,
394
+ GREATEST (0, age(pg_stat_replication.backend_xmin)) as backend_xmin_age,
394
395
GREATEST (0, EXTRACT(epoch from pg_stat_replication.write_lag)) as write_lag,
395
- GREATEST (0, EXTRACT(epoch from pg_stat_replication.replay_lag )) AS replay_lag ,
396
- GREATEST (0, age( pg_stat_replication.backend_xmin )) AS backend_xmin_age
396
+ GREATEST (0, EXTRACT(epoch from pg_stat_replication.flush_lag )) as flush_lag ,
397
+ GREATEST (0, EXTRACT(epoch from pg_stat_replication.replay_lag )) AS replay_lag
397
398
FROM pg_stat_replication as pg_stat_replication
398
399
LEFT JOIN pg_replication_slots as pg_stat_replication_slot
399
400
ON pg_stat_replication.pid = pg_stat_replication_slot.active_pid;
@@ -405,9 +406,10 @@ def get_list_chunks(lst, n):
405
406
{'name' : 'wal_client_addr' , 'type' : 'tag' },
406
407
{'name' : 'slot_name' , 'type' : 'tag_not_null' },
407
408
{'name' : 'slot_type' , 'type' : 'tag_not_null' },
408
- {'name' : 'wal_write_lag' , 'type' : 'gauge' },
409
- {'name' : 'wal_flush_lag' , 'type' : 'gauge' },
410
- {'name' : 'wal_replay_lag' , 'type' : 'gauge' },
409
+ {'name' : 'replication.backend_xmin_age' , 'type' : 'gauge' },
410
+ {'name' : 'replication.wal_write_lag' , 'type' : 'gauge' },
411
+ {'name' : 'replication.wal_flush_lag' , 'type' : 'gauge' },
412
+ {'name' : 'replication.wal_replay_lag' , 'type' : 'gauge' },
411
413
],
412
414
}
413
415
0 commit comments