prometheus: avoid index error

This commit is contained in:
Christophe Siraut 2020-12-04 16:43:21 +01:00
parent 19517b5f6c
commit bd758a09c0
1 changed files with 1 additions and 1 deletions

View File

@ -155,7 +155,7 @@ def postgresql(ctn):
eo_postgresql.labels(ctn, role, "replicators").set(0)
for p in psutil.process_iter():
cmd = p.cmdline()
if cmd and 'walsender' in cmd[0] or 'wal sender' in cmd[0]:
if cmd and ('walsender' in cmd[0] or 'wal sender' in cmd[0]):
eo_postgresql.labels(ctn, role, "replicators").inc()
else:
role = "secondary"