Setup API Key on SendGrid
- Go to your SendGrid account and go to API Keys section.
- Add new API Key with, at least,
Mail Send
permission. - Copy generated API Key. Your key should start with
SG.
Grafana setup
- You have to edit Grafana configuration. Refer to Grafana Configuration documentation on where to find your config file. For Bitnami Grafana distribution you can find it here:
/opt/bitnami/grafana/conf/grafana.ini
- Look for
[smtp]
section and either update existing one or add new one
[smtp]
enabled = true
host = smtp.sendgrid.net:587
user = apikey
password = YOUR_SENDGRID_API_KEY
skip_verify = false
from_address = admin@grafana.localhost
from_name = Grafana
3. Restart Grafana: official documentation, Bitnami documentation.
Testing
- Go to Alert notification channels (
/alerting/notifications
) - Create new channel with type
email
. - Add email address
- Hit
Test
- You should receive test notification sent by Grafana through SendGrid SMTP sevice!
Few remarks
enabled = true
– by default it’s false and then SMTP is disabled.
smtp.sendgrid.net:587
– you can try different ports but this one is recommended by SendGrid here Integrating with the SMTP API.
user
– you have to provide apikey
as user, otherwise you will end up with 550 Unauthenticated senders not allowed
.
skip_verify
– in other SMTP servers you may have to set this to true, yet for SendGrid it will cause problems as described in Notification channel Email cannot integrate with Sendgrid.
from_adress
– looks like you can put anything you want but I would recommend to put verified email address you have in SendGrid – check the Sender Authentication section.
Links
Grafana configuration reference
550 Unauthenticated senders not allowed
error code description.