Exercise 1: A HighMemoryUsage Alert Rule — Possible Solution ==================================================================== groups: - name: example rules: - alert: HighMemoryUsage expr: memory_usage_percent > 90 for: 15m labels: severity: warning annotations: summary: "Memory usage above 90% for {{ $labels.job }}" description: "Current value: {{ $value }}%" Explanation: The expr field is a plain PromQL boolean comparison against the gauge metric memory_usage_percent > 90 -- unlike the chapter's own counter- based HighErrorRate example, no rate()/increase() wrapping is needed here at all, since a gauge already directly represents "the current value right now," exactly the kind of value a plain threshold comparison is meant for. for: 15m matches the exercise's own requirement that the condition hold continuously for at least 15 minutes before the alert fires, filtering out a brief, temporary memory spike the same way the chapter's own 10m example filtered out transient error-rate blips. The annotations block includes {{ $value }} specifically because the exercise asked for the current value to be included -- $value is Alertmanager's own template variable holding whatever number the expr evaluated to at the moment the alert fired, giving whoever receives the notification the actual percentage without needing to go look it up separately. WHY THIS WORKS AS AN ANSWER ------------------------------ This writes a correctly structured alert rule matching the chapter's own YAML shape, uses a plain threshold comparison appropriate for a gauge metric (rather than needlessly wrapping it in rate()), and includes the specifically requested $value templating in the annotation.