Class LoggingAlertSink
java.lang.Object
com.kingsrook.qqq.backend.core.alerts.LoggingAlertSink
- All Implemented Interfaces:
AlertSinkInterface
The default alert sink, used when no alerts implementation is installed: it
logs. INFO signals log at INFO, WARNING and above at WARN. Logging is
rate-limited per (type, dedupKey), so a producer that raises the same alert
every few seconds writes one line per window, not thousands. Heartbeats
are not logged (they are expected, frequent and not a problem).
Notifications log at INFO (WARN for ERROR and CRITICAL), rate-limited per
(category, sourceKey or title).
With this sink, producer code paths are identical with and without an
alerts implementation - which is the point.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Durationhow long to stay quiet about a key after logging it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidHeartbeats are expected and frequent, so they are not logged.voidnotify(NotificationSignal signal) Log a user notification (there is no inbox without an implementation).voidraise(AlertSignal signal) Record (or refresh) an alert.voidresolve(AlertResolution resolution) Resolve an open alert, if there is one.
-
Field Details
-
RATE_LIMIT_WINDOW
how long to stay quiet about a key after logging it.
-
-
Constructor Details
-
LoggingAlertSink
public LoggingAlertSink()
-
-
Method Details
-
raise
Description copied from interface:AlertSinkInterfaceRecord (or refresh) an alert. The signal's occurredAt is always set.- Specified by:
raisein interfaceAlertSinkInterface
-
resolve
Description copied from interface:AlertSinkInterfaceResolve an open alert, if there is one. resolvedAt is always set.- Specified by:
resolvein interfaceAlertSinkInterface
-
heartbeat
Heartbeats are expected and frequent, so they are not logged.- Specified by:
heartbeatin interfaceAlertSinkInterface
-
notify
Log a user notification (there is no inbox without an implementation).- Specified by:
notifyin interfaceAlertSinkInterface
-