User Alerts
Application alerting on the ayedo SDP with Grafana Alerting: alert rules, contact points (Slack, Teams, email, webhook), notification policies, and silences.
User Alerts
On the ayedo Software Delivery Platform (SDP), you configure notifications for your own applications directly via Grafana Alerting. This enables you to monitor both metrics from VictoriaMetrics and log patterns from VictoriaLogs and route alerts to your team's existing channels.
Architecture Overview
VictoriaMetrics (App & Pod Metrics) ──┐
├──► Grafana Alerting (Rules & Policies) ──► Contact Points
VictoriaLogs (App Logs) ──┘ (Slack, Teams, Email, Webhook)
Everything you need for your alerts — rule definitions, routing, grouping, and temporary silences — is managed centrally in the Grafana UI under Alerting.
1. Setting Up Contact Points
A Contact Point defines where notifications are delivered.
- In Grafana, open Alerting → Contact points.
- Click Add contact point and assign a unique name (e.g.,
acme-backend-slack). - Select the desired integration type and enter the credentials:
| Channel | Typical Configuration |
|---|---|
| Slack | Incoming webhook URL or bot token + target channel (e.g., #acme-alerts) |
| Microsoft Teams | Incoming webhook URL of the Teams channel |
| One or more recipient addresses (semicolon-separated) | |
| Webhook | Any HTTPS endpoint (e.g., for incident tools, ticketing systems, or custom automations) |
| PagerDuty / Opsgenie | Integration key / API key of your on-call system |
- Click Test to trigger a test notification, then save the contact point.
2. Creating Alert Rules
An Alert Rule periodically evaluates a query against VictoriaMetrics or VictoriaLogs and transitions to Pending and then Firing when a threshold is breached.
Navigate to Alerting → Alert rules → New alert rule and select Grafana-managed alert rule:
- Name & folder: Choose a descriptive name and store the rule in your team's folder (e.g.,
acme-production). - Query (Query A): Select your data source (VictoriaMetrics or VictoriaLogs) and write the query.
- Expression & threshold: Define the trigger condition using
Reduce(e.g.,Last) andThreshold. - Evaluation behavior: Set the evaluation interval (e.g.,
1m) and Pending Period (for, e.g.,5m) to smooth out short spikes. - Labels & annotations: Add routing labels (e.g.,
severity=critical,team=acme-backend) along with a clearSummary,Description, and optionally aRunbook URL.
Example Queries for VictoriaMetrics (MetricsQL)
Repeated pod restarts (CrashLoop):
sum by (namespace, pod) (
increase(kube_pod_container_status_restarts_total{namespace="acme-production"}[15m])
) > 2
High HTTP 5xx error rate of an application:
sum(rate(http_requests_total{namespace="acme-production", status=~"5.."}[5m]))
/
sum(rate(http_requests_total{namespace="acme-production"}[5m])) > 0.05
High memory utilization relative to container limit:
sum by (pod) (container_memory_working_set_bytes{namespace="acme-production", container!=""})
/
sum by (pod) (kube_pod_container_resource_limits{namespace="acme-production", resource="memory"}) > 0.85
Persistently unavailable replicas of a Deployment:
kube_deployment_status_replicas_unavailable{namespace="acme-production"} > 0
Example Query for VictoriaLogs (LogsQL)
Spike in application errors in logs:
kubernetes.pod_namespace:"acme-production" AND level:"error" | stats count() as error_count
Configure a threshold condition in Grafana (e.g., error_count > 20 over a 5-minute evaluation window) to be notified of sudden error spikes.
3. Configuring Notification Policies
Under Alerting → Notification policies, you control which alerts are routed to which contact point.
- Default Policy: Defines the default contact point and grouping behavior (
Group by, e.g.,alertname,namespace). - Nested Policies (Label Matchers): Route alerts specifically based on labels:
team = acme-backendandseverity = critical→ on-call webhook /#acme-criticalteam = acme-backendandseverity = warning→#acme-warningsor email
Key Timing Parameters
| Parameter | Effect |
|---|---|
| Group wait | Short wait before sending the first notification to bundle related alerts in a group (e.g., 30s). |
| Group interval | Interval between updates when new alerts are added to the same group (e.g., 5m). |
| Repeat interval | Interval at which a still-active alert is re-sent (e.g., 4h). |
4. Silences for Maintenance and Releases
When planned releases, database migrations, or maintenance tasks may briefly trigger errors or restarts, selectively suppress individual notifications using a Silence:
- Open Alerting → Silences → Add silence.
- Set the start and end time.
- Add one or more label matchers (e.g.,
namespace = acme-stagingoralertname = HighErrorRate). - Add a brief comment (reason and owner) and save the silence.
Best Practices Against Alert Fatigue
- Separate clear severity levels: Reserve
severity=criticalfor acute user impact andseverity=warningfor early warnings (e.g., rising utilization). - Set a pending period (
for): Avoid immediate firing on single spikes — values between3mand10mreliably filter out brief rollouts. - Write actionable messages: Every alert should clearly state in
SummaryandDescriptionwhich service is affected, what state it is in, and where to find the team runbook or dashboard. - Alert on symptoms rather than causes alone: Prioritize user-facing effects (error rate, latency, unavailable pods) and supplement selectively with capacity early warnings.
- Choose no-data behavior deliberately: Specify per rule whether missing data should evaluate as
OK,Alerting, orKeep Last State(e.g., for infrequent CronJobs or after scale-to-zero).