Skip to content

Commit 87cb748

Browse files
authored
Fix timeline metric None value (patroni#3165)
Close patroni#3164
1 parent bfa9b0c commit 87cb748

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

kubernetes/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ bootstrap:
1515
pg_hba:
1616
- host all all 0.0.0.0/0 md5
1717
- host replication ${PATRONI_REPLICATION_USERNAME} ${PATRONI_KUBERNETES_POD_IP}/16 md5
18+
- host replication ${PATRONI_REPLICATION_USERNAME} 127.0.0.1/32 md5
1819
initdb:
1920
- auth-host: md5
2021
- auth-local: trust

patroni/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ def do_GET_metrics(self) -> None:
655655

656656
metrics.append("# HELP patroni_postgres_timeline Postgres timeline of this node (if running), 0 otherwise.")
657657
metrics.append("# TYPE patroni_postgres_timeline counter")
658-
metrics.append("patroni_postgres_timeline{0} {1}".format(labels, postgres.get('timeline', 0)))
658+
metrics.append("patroni_postgres_timeline{0} {1}".format(labels, postgres.get('timeline') or 0))
659659

660660
metrics.append("# HELP patroni_dcs_last_seen Epoch timestamp when DCS was last contacted successfully"
661661
" by Patroni.")

0 commit comments

Comments
 (0)