Grafana - Alerts



 

In Grafana, alerts are one way of notifying the users that a particular abnormal acitivity has occured in the application. Here users can be product support team, product management or development team. Alerts are really useful in the production evironment where above mentioned teams will get notified before the customer reports to them or sometimes even before the customer notice it.

Notification Channel

Before creating an alert, notification channel needs to be created to which the alert message to be sent. Follow the below steps to create a notification channel.

Integration with Slack

  1. Create a slack app from here. This will show the below dialog. 
  2. Fill in the app name and development slack workspace. If you do not have one, create one for you.
  3. Select Incoming Webhooks from the left navigation pane. 
  4. Copy the web hook url from the bottom of the page. 

Create Notification Channel in Grafana

  1. Login to Grafana and move to Alerts ⭆ Notification channels menu.
  2. Click on New channel button at the right side of the page.
  3. Provide the appropriate details as mentioned below. 
    1. Free text in Name text box.
    2. Select Slack in Type dropdown.
    3. Copy / Paste the web hook url in URL settings. 
  4. Check if the provided settings works by clicking the Send Test button.

Create Alert

  1. Select a panel from any dashboard to which you wish to create an alert and from the dropdown icon in the panel, choose Edit option. 
  2. From the query editor, select a Alert icon in the left navigatio menu to create alert. And click on Create Alert button. NOTE: your panel should not contain variables. 
  3. Do the necessary changes as per your need in the Condition section of alert.
  4. Provide the notification message and select the notification channel in the Notifications section.
  5. Press save icon on the top of the page once you are done.
By now, you are done with configuring the alert in grafana and you would receive an alert message on your slack. 




Comments