Fix timeline metric None value (#3165)

Close #3164
This commit is contained in:
Brian Hartford
2024-09-17 04:06:37 -04:00
committed by GitHub
parent bfa9b0ca4b
commit 87cb7481ae
2 changed files with 2 additions and 1 deletions

View File

@@ -15,6 +15,7 @@ bootstrap:
pg_hba:
- host all all 0.0.0.0/0 md5
- host replication ${PATRONI_REPLICATION_USERNAME} ${PATRONI_KUBERNETES_POD_IP}/16 md5
- host replication ${PATRONI_REPLICATION_USERNAME} 127.0.0.1/32 md5
initdb:
- auth-host: md5
- auth-local: trust

View File

@@ -655,7 +655,7 @@ class RestApiHandler(BaseHTTPRequestHandler):
metrics.append("# HELP patroni_postgres_timeline Postgres timeline of this node (if running), 0 otherwise.")
metrics.append("# TYPE patroni_postgres_timeline counter")
metrics.append("patroni_postgres_timeline{0} {1}".format(labels, postgres.get('timeline', 0)))
metrics.append("patroni_postgres_timeline{0} {1}".format(labels, postgres.get('timeline') or 0))
metrics.append("# HELP patroni_dcs_last_seen Epoch timestamp when DCS was last contacted successfully"
" by Patroni.")