Shorten debug output

This commit is contained in:
Joshua Boniface 2023-12-07 11:23:25 -05:00
parent 1b84553405
commit bf158dc2d9
2 changed files with 3 additions and 9 deletions

View File

@ -117,9 +117,8 @@ class MonitoringPluginScript(MonitoringPlugin):
# Handle some exceptional cases # Handle some exceptional cases
if health_delta > 0: if health_delta > 0:
if coordinator_state in ["takeover", "relinquish"]: if coordinator_state in ["takeover", "relinquish"]:
# This scenario occurrs if this plugin run catches a node transitioning from primary to secondary coordinator # This scenario occurrs if this plugin run catches a node transitioning from primary to
# secondary coordinator. We can ignore it.
# We can ignore it.
health_delta = 0 health_delta = 0
message = "Patroni PostgreSQL error reported but currently transitioning coordinator state; ignoring." message = "Patroni PostgreSQL error reported but currently transitioning coordinator state; ignoring."

View File

@ -571,14 +571,9 @@ class MonitoringInstance(object):
if self.config["debug"]: if self.config["debug"]:
self.logger.out( self.logger.out(
f"Entries for fault check {fault_type}:", f"Entries for fault check {fault_type}: {dumps(entries)}",
state="d", state="d",
) )
for line in dumps(entries, indent=2).split("\n"):
self.logger.out(
line,
state="d",
)
for _entry in entries: for _entry in entries:
entry = _entry["entry"] entry = _entry["entry"]