Goal
Platform and application metrics in one place, dashboards stored in Git, and alerts that reach Slack. Every alert rule is proven by causing the condition, not by trusting that it loaded.
- Platform metricskube-prometheus-stack on the monitoring node pool; Argo CD, cert-manager, Gatekeeper, Falco and Trivy Operator are targets.Live
- Application metricsRequest counts and latency by route, WebSocket connections, messages and connection attempts by result.Live
- Dashboards in GitGrafana dashboards stored as ConfigMaps, reviewed like code.Live
- Alert rulesApiScrapeDown, ApiHighErrorRate, ApiHighLatencyP95, WebSocketRejectionsHigh and EdgeHighErrorRate.Live
- Slack deliveryAlertManager sends firing and resolved messages to Slack.Live
Steps and commands
Run these in dev first. Every step has a check that proves it worked, so you are never guessing.
Create the Slack webhook secret
Keep the webhook URL out of Git. AlertManager reads it from a Secret.
$ read -rsp "Slack webhook URL: " HOOK; echo $ kubectl -n monitoring create secret generic alertmanager-slack --from-literal=url="$HOOK" $ unset HOOKCheck: the secret exists and the AlertManager pod starts without configuration errors.Enable application scraping per environment
Switch on metrics with a chart flag. It creates a PodMonitor and a NetworkPolicy so Prometheus can reach the api. Merge the image first, then the flag.
# environments/dev/values.yaml metrics: enabled: trueCheck: the api target is UP in Prometheus and ApiScrapeDown does not fire.Check the alert rules loaded
A rule that is missing from the cluster cannot fire.
$ kubectl get prometheusrule -n monitoring $ kubectl -n monitoring port-forward svc/kube-prometheus-stack-alertmanager 9093Check: all five application rules are listed and healthy.Prove an alert by causing it
Apply a temporary rule with kubectl (not Git) that fires when a WebSocket is open, open a chat room in a browser tab and watch it reach Slack. Close the tab for the resolved message.
$ kubectl apply -f test-rule.yaml # open a chat room, wait for the Slack message, close the tab $ kubectl delete prometheusrule paktech-alert-test -n monitoringCheck: the firing message and the resolved message both arrive, and the test rule is deleted afterwards.
Workflow
How a signal travels from a pod to a person.
- STEP 1ScrapePrometheus pulls /metrics
- STEP 2EvaluateAlert rules
- STEP 3RouteAlertManager
- STEP 4NotifySlack
- STEP 5DisplayGrafana dashboards
Rollback: Set metrics.enabled back to false and merge. Argo CD removes the PodMonitor and the NetworkPolicy; the app itself is unaffected.
Diagram




Issues met
These are real, from the run. The surprises are the useful part.
Trade-offs
Why: One series per route instead of one per room keeps the cardinality low.
It costs: You lose per-room detail in metrics. Logs are for that.
Why: Calls to the Anthropic API are legitimately slow and would make the alert noisy.
It costs: A slow AI route needs its own, separate rule.