Setup Alert Notification Channels in Grafana

grafana logo
Reading Time: 3 minutes

In this blog, We will setup step by step grafana email and slack Alert Notification Channels to send the alerts via a grafana.

Supported Alert Notification Channels

  • Email
  • Slack
  • Kafka
  • Google Hangouts Chat
  • Microsoft Teams
  • etc.

so In this blog, we will set up the Email and Slack notification channel only to send alerts.

Setup Email Alerts Notification Channel

To set up email alerts in grafana, so we need to configure the SMTP settings in the grafana.ini file which is stored in /etc/grafana/grafana.ini

1. ssh to the grafana node

ssh hostname@ip

2. Edit the grafana configuration

sudo vim /etc/grafana/grafana.ini

3. Change the SMTP configuration and save it.

######### SMTP / Emailing #######
[smtp]
;enabled = true
;host = smtp-mail.outlook.com:587 #Port 25(Without TLS/SSL) 
;user = Your_Email_Address@gmail.com
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
;password = """Your_Password"""
;cert_file =
;key_file =
;skip_verify = true
;from_address = Your_Email_Address@gmail.com
;from_name = Your_Name
# EHLO identity in SMTP dialog (defaults to instance_name)
;ehlo_identity =

[emails]
;welcome_email_on_sign_up = false
;templates_pattern = emails/*.html

4. Restart the grafana server

sudo service grafana-server restart

5. Open the grafana app and go to the alert icon and click notification channels.

Grafana Alerting

6. Click on the new channel

Grafana Click on New Channel

7. Select type email and Add the email notification configuration details

Grafana Notification Channel

8. Save

Now you have successfully set up the email notification channel.

Setup Slack Alerts

1. Go to the https://api.slack.com/apps

2. Click on  

Grafana create app icon
Slack App Setting

 3. Click on Create App

4. Click on Incoming Webhook

Grafana incomming webhook

5. Activate

Grafana activate incoming webhook

6. Click on

Grafana add new workspace

7. Select the slack channel and click on allow.

8. Copy the webhook URL

Grafana webhook url

9. Open the grafana app and go to the alert icon and click notification channels.

Grafana Grafana Alerting

10. Click on the new channel

Grafana click on new channel

11. Select type slack and then insert the webhook URL

Grafana Alerts Setting

12. Click on Save

Now you have successfully set up the slack notification channel.

Thank you for sticking to the end. If you like this blog, please do show your appreciation by giving thumbs-ups and share this blog and give me suggestions on how I can improve my future posts to suit your needs. Follow me to get updates on different technologies


References

knoldus Bottom Image

Written by 

Azmat Hasan is a Software Consultant at Knoldus Software LLP. He has done MCA from CDAC Noida in 2019. He has good knowledge of DevOps technologies i.e docker, Ansible, CI/CD(Jenkins, Bamboo), Kubernetes, Monitoring(Prometheus, Grafana), Logging(ELK Stack), etc. He is a self-motivated, enthusiastic person who believes in striving to achieve what we can sustain over a longer period of time, instead of working for short term benefits. He believe in working together to create synergy.