# Pmm-client PG replication lag and patroni metrics

**URL:** <https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800>\
**Category:** Percona Operator for PostgreSQL\
**Created:** [May 24, 2022, 1:39pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800 "2022-05-24T13:39:40Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_Zhuravlev](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_zhuravlev/32/6410_2.png) [@Sergey\_Zhuravlev](https://forums.percona.com/u/Sergey_Zhuravlev)\
**Post date:** [May 24, 2022, 1:39pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/1 "2022-05-24T13:39:40Z")

</div>

Hi,  
Enabled monitoring pmm-client and install pmm-server for test.  
I do not see any metrics about PG replication, such as lag.  
As well as metrics that relate to patroni.

Are they really not? I want to see the replication lag.  
Is it configurable somehow?  
How to fix it?

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [June 13, 2022, 8:40am UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/2 "2022-06-13T08:40:37Z")

</div>

It is not possible to configure replication lag for nodes with the Operator yet. What would be your requirements here? We have it in our roadmap and it would be cool to understand the set of problems you want to solve with this.

As for monitoring - let me check with our PG experts if we have anything. @Umair_Shahid @Charly_Batista - is it possible to monitor replication lag in PMM?

---

<div class="post-metadata">

**Author:** ![sshine](https://avatars.discourse-cdn.com/v4/letter/s/71c47a/32.png) [@sshine](https://forums.percona.com/u/sshine)\
**Post date:** [June 16, 2022, 7:04am UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/4 "2022-06-16T07:04:09Z")

</div>

is it possible to monitor postgresql replication lag in PMM?

---

<div class="post-metadata">

**Author:** ![Sergey\_Pronin](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/sergey_pronin/32/14887_2.png) [@Sergey\_Pronin](https://forums.percona.com/u/Sergey_Pronin)\
**Post date:** [June 20, 2022, 8:41am UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/5 "2022-06-20T08:41:17Z")

</div>

From what I got from our experts - it is not possible right now.

---

<div class="post-metadata">

**Author:** ![Asuwini\_P](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/asuwini_p/32/9824_2.png) [@Asuwini\_P](https://forums.percona.com/u/Asuwini_P)\
**Post date:** [June 20, 2023, 12:12pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/6 "2023-06-20T12:12:11Z")

</div>

Hi @Sergey_Pronin ,

Is it possible now to check the PostgreSQL Replication Lag ? I could see the metrics, but data is not being populating. Do we need to enable any collector? Is there a solution for this issue, aside from custom queries?

 ![Screenshot 2023-06-20 at 5.36.01 PM](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/5/540eb5b5cd050c69d6ac6d1473681331711ae6d2.png)

---

<div class="post-metadata">

**Author:** ![Roma\_Novikov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roma_novikov/32/1161_2.png) [@Roma\_Novikov](https://forums.percona.com/u/Roma_Novikov)\
**Post date:** [June 23, 2023, 1:28pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/7 "2023-06-23T13:28:13Z")

</div>

@Asuwini_P, is this some default or customized dashboard?  
Filtering and grouping by `node_name` should not be used in this case; its `service_name` should be there. Try to replace it.  
I’ve checked our PMM demo ([Grafana](https://pmmdemo.percona.com/graph/d/prometheus-advanced/advanced-data-exploration?orgId=1&refresh=1m&var-metric=pg_replication_lag&var-interval=$__auto_interval_interval&var-node_name=All) ) and the metrics present; we don’t have any PG replication on the Depo server for now.  
Please check what version of PMM Client you use.

---

<div class="post-metadata">

**Author:** ![Asuwini\_P](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/asuwini_p/32/9824_2.png) [@Asuwini\_P](https://forums.percona.com/u/Asuwini_P)\
**Post date:** [June 23, 2023, 1:55pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/8 "2023-06-23T13:55:00Z")

</div>

Hi @Roma_Novikov

Thank you for your response,

It is customized dashboard, but the exporters are the same. I am using percona postgres\_exporter

I have replaced with service\_name as well. Only I can see the monitored node(pmm-server) service name.

PMM Version : 2.37.1 (latest)

 ![Screenshot 2023-06-23 at 7.21.17 PM](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/8/8beb251b7bd2dc021a281c4ca20efb38df2d5d42.png)

---

<div class="post-metadata">

**Author:** ![Roma\_Novikov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/roma_novikov/32/1161_2.png) [@Roma\_Novikov](https://forums.percona.com/u/Roma_Novikov)\
**Post date:** [June 30, 2023, 1:11pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/9 "2023-06-30T13:11:33Z")

</div>

@Asuwini_P , are you using the exporter separately or as a part of the pmm-client component?  
As the mentioned metric is a part of our customization on top of the community version.

---

<div class="post-metadata">

**Author:** ![Asuwini\_P](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/asuwini_p/32/9824_2.png) [@Asuwini\_P](https://forums.percona.com/u/Asuwini_P)\
**Post date:** [June 30, 2023, 2:40pm UTC](https://forums.percona.com/t/pmm-client-pg-replication-lag-and-patroni-metrics/15800/10 "2023-06-30T14:40:36Z")

</div>

@Roma_Novikov , I am using pmm postgresql exporter
