PMM3 postgres on Read only => pg_custom_replication_wal pq: recovery is in progress

Since the last version, our syslog is being spammed on read only postgres slaves:

Jul 15 10:15:59 pmm-agent[2743907]: time=“2025-07-15T10:15:59.975+01:00” level=error msg=“ts=2025-07-15T09:15:59.974Z caller=server.go:132 level=error namespace=pg_custom_replication_wal msg="Error running query on database \"xx:5432\": pg_custom_replication_wal pq: recovery is in progress"” agentID=xxx-e4ec-4baa-8c05-0c24573f62b9 component=agent-process type=postgres_exporter
Jul 15 10:15:59 pmm-agent[2743907]: time=“2025-07-15T10:15:59.975+01:00” level=error msg=“ts=2025-07-15T09:15:59.974Z caller=postgres_exporter.go:770 level=error err="queryNamespaceMappings returned 1 errors"” agentID=xxx-e4ec-4baa-8c05-0c24573f62b9 component=agent-process type=postgres_exporter

@bart.schelstraete It looks like you are running some custom metric collector:- pg_custom_replication_wal, which is unable to perform operations on read-only replicas. Do you have the details on what exactly the custom metrics are trying to get or execute?

If I am correct, you are not seeing these messages in the Primary. Right?

I’ve run into the same issue, described more in detail in this github issue. There is monitoring in my kluster already present, but it does not autodetect anything and is also not configured to scrape from these instances. So I don’t think it has anything to do with custom queries, but rather with the configuration of pmm-client that natively ships with operator 2.7.0. Or, as I assume, it has something to do with the postgres_exporter and its inability to skip querying instances that are in replica state.

I have same issues on the slaves. Is there any solutions for slave databases?
What’s the best practise for postgres clusters with PMM?