# Pg\_exporter\_last\_scrape\_error provides 1 on crunchy cluster replica

**URL:** <https://discuss.prometheus.io/t/pg-exporter-last-scrape-error-provides-1-on-crunchy-cluster-replica/1981>\
**Category:** Exporters and Metrics\
**Created:** [October 23, 2023, 1:35pm UTC](https://discuss.prometheus.io/t/pg-exporter-last-scrape-error-provides-1-on-crunchy-cluster-replica/1981 "2023-10-23T13:35:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dominik0711](https://dub1.discourse-cdn.com/flex017/user_avatar/discuss.prometheus.io/dominik0711/32/838_2.png) [@dominik0711](https://discuss.prometheus.io/u/dominik0711)\
**Post date:** [October 23, 2023, 1:35pm UTC](https://discuss.prometheus.io/t/pg-exporter-last-scrape-error-provides-1-on-crunchy-cluster-replica/1981/1 "2023-10-23T13:35:05Z")

</div>

Hi. I’m using the postgres\_exporter for my crunchy cluster. I have 3 instances of one database running. 1 leader and 2 replicas. I have configured an alert pg\_exporter\_last\_scrape\_error \> 0 to fire if pg\_exporter\_last\_scrape\_error is greater 0 for 60s. I get an alert when the alert query is executed on a replica. Is this an error of the postgres\_exporter or should the expression only be performed on the leader of the cluster? How can the expression be executed only on the leader instance?  
Thanks for your help!
