Monitoring alerts formatting improvements

This commit is contained in:
ViacheslavKlimov 2024-01-04 12:36:38 +02:00
parent 04cab4d5d1
commit e9a7bc440e
3 changed files with 3 additions and 3 deletions

View File

@ -25,7 +25,7 @@ public class TransportInfo {
@Override @Override
public String toString() { public String toString() {
return String.format("%s (%s)", transportType.getName(), baseUrl); return String.format("*%s* (%s)", transportType.getName(), baseUrl);
} }
} }

View File

@ -34,7 +34,7 @@ public class HighLatencyNotification implements Notification {
StringBuilder text = new StringBuilder(); StringBuilder text = new StringBuilder();
text.append("Some of the latencies are higher than ").append(thresholdMs).append(" ms:\n"); text.append("Some of the latencies are higher than ").append(thresholdMs).append(" ms:\n");
highLatencies.forEach(latency -> { highLatencies.forEach(latency -> {
text.append(String.format("[%s] %s\n", latency.getKey(), latency.getFormattedValue())); text.append(String.format("[%s] *%s*\n", latency.getKey(), latency.getFormattedValue()));
}); });
return text.toString(); return text.toString();
} }

View File

@ -38,7 +38,7 @@ monitoring:
check_timeout_ms: '${CHECK_TIMEOUT_MS:5000}' check_timeout_ms: '${CHECK_TIMEOUT_MS:5000}'
# Failures threshold for notifying # Failures threshold for notifying
failures_threshold: '${FAILURES_THRESHOLD:2}' failures_threshold: '${FAILURES_THRESHOLD:1}'
# Notify after each REPEATED_FAILURE_NOTIFICATION subsequent failures, 0 to notify only once on first failure # Notify after each REPEATED_FAILURE_NOTIFICATION subsequent failures, 0 to notify only once on first failure
repeated_failure_notification: '${REPEATED_FAILURE_NOTIFICATION:4}' repeated_failure_notification: '${REPEATED_FAILURE_NOTIFICATION:4}'