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
- Create a slack app from here. This will show the below dialog.
- Fill in the app name and development slack workspace. If you do not have one, create one for you.
- Select Incoming Webhooks from the left navigation pane.
- Copy the web hook url from the bottom of the page.
Create Notification Channel in Grafana
- Login to Grafana and move to Alerts ⭆ Notification channels menu.
- Click on New channel button at the right side of the page.
- Provide the appropriate details as mentioned below.
- Free text in Name text box.
- Select Slack in Type dropdown.
- Copy / Paste the web hook url in URL settings.
- Check if the provided settings works by clicking the Send Test button.
Create Alert
- 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.
- 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.
- Do the necessary changes as per your need in the Condition section of alert.
- Provide the notification message and select the notification channel in the Notifications section.
- 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
Post a Comment