Chapter 95: Logging with Loki, Elastic Stack and CloudWatch
95.16 Alert principles — useful signals without sending alerts
Story (fictional teaching scenario). At a fictional Mysuru bakery, Emma and Ken from Kyoto prefer one actionable warning over a phone notification for every repeated stack line.
Why
A noisy alert can hide a serious incident; a quiet pipeline can also hide missing data.
What
- An alert rule evaluates a condition over a time window.
- A threshold is a chosen boundary, not automatically a universal safe value.
- Sustained evaluation requires the condition to remain true long enough to reduce transient noise.
- Missing data is not necessarily zero errors: the app or collector may be silent.
- A runbook explains what a responsible operator should check.
How
-
Define who owns the signal and what action is possible.
-
Use an appropriate denominator and minimum traffic.
-
Account for missing data and duplicate events.
-
Test routing in an explicitly approved environment; this chapter sends nothing.
Example 1: A paper-only rule
- Read the command or request.
If error_percent >20 for 3 evaluation windows AND requests >=100:
proposed state = investigate
If no events arrive:
proposed state = data_missing
- Read the result.
Output (illustrative; NOT executed against Loki, Elastic or CloudWatch)
For the six-event lab, the minimum-traffic condition is not met; no alert is sent.
- Line by line: The numbers are fictional teaching choices, not production recommendations. A six-event sample has 33.33 percent errors, but it cannot prove an alert should wake someone. Missing events need a separate diagnosis. No alert engine, integration or external message is configured.
Ravindra Bagale's Tip
No data and zero errors are different states.
Data नाही आणि errors शून्य आहेत या वेगळ्या गोष्टी आहेत.
Data नहीं और zero errors अलग स्थितियाँ हैं.
Did you understand? Let us try it once more.