How to Configure Email Alerts in Grafana

Grafana Alerting helps you monitor your systems and receive email notifications when specific conditions are met. This guide explains how to configure email alerts in Grafana using Gmail SMTP.

Prerequisites

  • Grafana installed and running
  • A Gmail account

Gmail App Password enabled (recommended)
Step 1: Configure SMTP Settings

Open the grafana.ini file and locate the [smtp] section.

Update the configuration as shown below:

[smtp]
enabled = true
host = smtp.gmail.com:587
user = yourmail@gmail.com
password = your_app_password
skip_verify = false
from_address = yourmail@gmail.com
from_name = Grafana


Note: If your password contains # or ;, wrap it with triple quotes:

password = “”“#password;”“”

Save the file after making the changes.

Step 2: Restart Grafana Service

After updating the SMTP configuration, restart the Grafana service.

On Windows

  1. Open Services
  2. Search for Grafana
  3. Right-click the service

Click Restart

Step 3: Open Alert Rules

  1. Log in to Grafana.
  2. Navigate to Alert Rules.

Step 4: Create a New Alert Rule

Click New Alert Rule to create a new alert.





Configure the Alert Query (Free space %)

100 * (
  sum by (instance, description) (
    windows_logical_disk_free_bytes{volume="C:"}
  )
  /
  sum by (instance, description) (
    windows_logical_disk_size_bytes{volume="C:"}
  )
)
* on(instance) group_left(hostname)
windows_cs_hostname

Define the Alert Condition


Configure Evaluation Settings
Set:

  • Evaluation interval
  • Pending period
  • Alert group

These settings determine how often Grafana evaluates the rule.
Configure Contact Point

Select an existing contact point.

If no contact point exists:

  1. Click View or Create Contact Point
  2. Create a new Email contact point
  3. Enter the recipient email address
  4. Click Save

Customize Alert Message (Optional)

You can define a custom subject and message template for email notifications.

This helps provide more context when an alert is triggered.

Save the Alert Rule

Click Save and Exit.

Your alert rule is now active.

Step 5: Verify the Alert

When the configured condition is met, Grafana will automatically send an email notification to the configured recipients.

You can test the alert by temporarily lowering the threshold value and verifying that the email is received successfully.


Conclusion

Grafana’s built-in alerting system makes it easy to monitor critical metrics and receive email notifications in real time. By configuring SMTP settings and creating alert rules, you can quickly set up automated monitoring and stay informed about important system events.