prometheus: avoid index error
This commit is contained in:
parent
19517b5f6c
commit
bd758a09c0
|
@ -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"
|
||||
|
|
Loading…
Reference in New Issue