You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running the SQL exporter on a PostgreSQL cluster and by default, my collected metrics get several labels added.
Also, a hostname label which makes it easy to work with the values of the primary PostgreSQL cluster node. But only, if the primary role is always running on the same node. This works of course, because I know that host XYZ is usually the primary host.
But if you have a failover or maintenance, the primary role could be on another host. So I would have to change all my queries in Alertmanager or Grafana to point to another hostname. This makes of course no sense.
For these cases, it would be awesome to have a label in the metrics that reflect if this metric comes from a primary or a standby/potential node.
For example the query:
postgres=# select pg_is_in_recovery();
pg_is_in_recovery
-------------------
t
(1 row)
would identify if this host is a primary or not. It returns True if recovery is still in progress(so the server is running in standby mode or slave).
Is there a way to get this label into a query definition?
The text was updated successfully, but these errors were encountered:
I am running the SQL exporter on a PostgreSQL cluster and by default, my collected metrics get several labels added.
Also, a hostname label which makes it easy to work with the values of the primary PostgreSQL cluster node. But only, if the primary role is always running on the same node. This works of course, because I know that host XYZ is usually the primary host.
But if you have a failover or maintenance, the primary role could be on another host. So I would have to change all my queries in Alertmanager or Grafana to point to another hostname. This makes of course no sense.
For these cases, it would be awesome to have a label in the metrics that reflect if this metric comes from a primary or a standby/potential node.
For example the query:
would identify if this host is a primary or not. It returns True if recovery is still in progress(so the server is running in standby mode or slave).
Is there a way to get this label into a query definition?
The text was updated successfully, but these errors were encountered: