<aside> ๐ญ
This chapter is optional. Do it after the assignment if you have time and curiosity โ it is not required for submission, but it is a satisfying capstone: your system will email you when it is in trouble.
</aside>
Your dashboard from Health & Metrics has one flaw: it only helps while someone is looking at it. Nobody stares at dashboards on a Saturday. An alert flips the direction โ instead of you checking the system, the system contacts you when a condition you defined becomes true. This is the mechanism behind every on-call rotation you will ever join.
You already know how to measure trouble โ in the dashboard you counted log lines by level. An alert is the same idea, narrowed to one number. Grafana's UI evolves, but creating an alert always comes down to the same four decisions:
app = my-app, add level = ERROR, then Operations โ Aggregations โ Count. That gives a single number: how many errors in the window.An alert you have never seen fire is a hope, not a safety net. Trigger it deliberately. First, add a temporary endpoint to your project:
@GetMapping("/api/test-alert")
public String testAlert() {
log.error("Test alert: this is a drill");
return "Error logged";
}
Then:
<aside> ๐
An email from your own production system, telling you it is unwell, seconds after it happened โ before any user complained. That is the whole point of this week, closing the loop on its own.
</aside>
The rookie mistake with alerts is making too many. An inbox full of alerts that "are probably fine" trains you to ignore them โ the industry calls this alert fatigue, and it is how real outages get missed. The professional rule: every alert must be actionable. If the honest response to an alert is "do nothing", the alert should not exist โ that information belongs on a dashboard, not in your inbox. One good alert (errors are happening) beats ten noisy ones.
The HackYourFuture curriculum is licensed underย CC BY-NC-SA 4.0 *https://hackyourfuture.net/*

Built with โค๏ธ by the HackYourFuture community ยท Thank you, contributors
Found a mistake or have a suggestion? Let us know in the feedback form.