Create an alert
Alerts in groundcover leverage a fully integrated Grafana interface. To learn how you can create alerts using Grafana Terraform, follow this guide.
Setup an alert based on metrics
Setting up an alert in groundcover involves defining conditions based on data collected in the platform, such as metrics, traces, logs, or Kubernetes events. This guide will walk you through the process of creating an alert based on metrics. More guides will follow to include all different types of data.
Step 1: Access the Alerts section
Log in to groundcover and navigate to the Alerts section by clicking on it on the left navigation menu.
Once in the Alerts section, click on Alerting in the inner menu on the left.
If you can't see the inner menu, click on the 3 bars next to "Home" in the upper left corner.
Click on Alert Rules
Then click on the blue "+ New alert rule" button in the upper right.
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252F4x7B3oxuxBkrGSD9FK1L%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25201.png%3Falt%3Dmedia%26token%3Dab35a0b0-c3bd-4498-91ae-188034eb8aca&width=768&dpr=4&quality=100&sign=a7467a85&sv=1)
Step 2: Give the alert a name and define query and conditions
Type a name for your alert. It's recommended to use a name that will make it easy for you to understand its function later.
Select the data source:
ClickHouse: For alerts based on your traces, logs, and Kubernetes events.
Prometheus: For alerts based on metrics (includes APM metrics, infrastructure metrics, and custom metrics from your environment)
Click on "Select metric"
Note: Make sure you are in "Builder" view (see screenshot) to see this option.
Click on "Metrics explorer"
Start typing the name of the metric you want this alert to be based on. Note that the Metrics explorer will start displaying matches as you type, so you can find your metric even if you don't remember it exact name. You can also check out our list of Metrics & Labels.
Once you see your metric in the list, click on "Select" in that row.
Note: You can click on "Run queries" to see the results of this query.
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252F6nZalpMSWwcc8Dqoc6sU%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25202.png%3Falt%3Dmedia%26token%3D49996c05-5454-4d74-89cc-af370375f496&width=768&dpr=4&quality=100&sign=96b497e5&sv=1)
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252FwkJ2lGiaHwEcR19Tqdtv%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25203.png%3Falt%3Dmedia%26token%3D6fb4617c-16a8-43cb-af53-d6a867b1fae0&width=768&dpr=4&quality=100&sign=473fea52&sv=1)
Step 3: Define expressions - Reduce & Threshold
In the Reduce section, open on the "Function" dropdown menu and choose the type of value you want to use.
Min - the lowest value
Max - the highest value
Mean - the average of the values
Sum - the sum of all values
Count - the number of values in the result
Last - the last value
In the Threshold section, type a value and choose whether you want the alert to fire when the query result is above or below that value. You can also select a range of values.
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252Fkaje6JlcjNppPPGEk0KE%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25204.png%3Falt%3Dmedia%26token%3D3836c6da-5e85-495f-a63b-0c3b9ef72be2&width=768&dpr=4&quality=100&sign=aaf6200f&sv=1)
Step 4: Set evaluation behavior
Click on "+ New folder" and type a name for the folder in which this rule will be stored. You can choose any name, but it's recommended to use a name that will make it easy for you to find the relevant evaluation groups, should you want to use them again in future alerts.
Click on "+ New evaluation group" and type a name for this evaluation group. The same recommendation applies here too.
In the Evaluation interval textbox, type how often the rule should be evaluated to see if it matches the conditions set in Step 3. Then, click "Create". Note: For the Evaluation interval, use the format (number)(unit), where units are:
s = seconds
m = minutes
h = hours
d = days
w = weeks
In the Pending period box, type how often you want the alert to match the conditions before it fires.
Evaluation interval = how often do you want to check if the alert should fire
Pending period = how long do you want this to be true before it fires
As an example, you can define the alert to fire only if the Mean percentage of memory used by a node is above 90% in the past 2 minutes (Pending period = 2m) and you want to check if that's true every 30 seconds (Evaluation interval = 30s).
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252FRpfJs74iOJYgTPTcD8uo%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25205.png%3Falt%3Dmedia%26token%3De6552a2f-2bb3-4ead-8555-2b8b7fa36e3d&width=768&dpr=4&quality=100&sign=20cd547e&sv=1)
Step 5: Choose contact point
If you already have a contact point set up, simply select it from the dropdown menu at the bottom of the "Configure lables and notifications" section. If not, click on the blue "View or create contact points" link, which will open a new tab.
Click on the blue "Add contact point" button
This will get you to the Contact points screen. Then:
Type a name for the contact point
From the dropdown menu, choose which system you want to use to push the alert to.
The information required to push the alert will change based on the system you select. Follow on-screen instructions (for example, if email is selected, you'll need to enter the email address(es) for that contact.
Click "Save contact point"
You can now close this tab to go back to the alert rule screen.
Next to the link you clicked to create this new contact point, you'll find a dropdown menu, where you can select the contact point you just created.
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252Fczo5yNzKMDxHxFUM9kf1%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25206.png%3Falt%3Dmedia%26token%3D8ffeb7cf-0443-405d-a164-05009a0049d6&width=768&dpr=4&quality=100&sign=446108cb&sv=1)
Step 6: Add annotations
Under "Add annotations", you have two free text boxes that give you the option to add any information that can be useful to you and/or the recipient(s) of this alert, such as a summary that reminds you of the alert's functionality or purpose, or next step instructions when this alert fires.
Step 7: Save and exit
Once all of it is ready, you can click the blue "Save rule and exit" button on the upper right of the screen, which will bring you back to the Alert rules screen. You will now be able to see your alert, as well as its status - normal (green), pending (yellow), or firing (red), as well as the Evaluation interval (blue).
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252F98Arm4rDlQgYVsYZbr1m%252FSetting%2520up%2520an%2520alert%2520-%2520Step%25207.png%3Falt%3Dmedia%26token%3D79b3c5d3-649f-424f-9229-4b1f6c68d4c4&width=768&dpr=4&quality=100&sign=c7e3cc16&sv=1)
Configuring Alert from existing dashboard:
Log in to your groundcover account and navigate to the dashboard that you want to create an alert from.
Locate the Grafana panel that you want to create an alert from and click on the panel's header and select edit .
Click on the alert tab as seen in the image below. Select the Manage alerts option from the dropdown menu.
Click on the New Alert Rule button.
Note:
only time series panels support alert creation.
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252FQpo95e2GoTy6wAiQmQi9%252FScreen%2520Shot%25202023-04-16%2520at%252018.43.38.png%3Falt%3Dmedia%26token%3D13f2109a-0e50-408a-8a3c-db36d5c8a2c0&width=768&dpr=4&quality=100&sign=576cac68&sv=1)
An alert is derived from three parts that will be configured in the screen that you are navigated to:
Expression - the query that defines the alert input itself,
Reduction - the value that should be leveraged from the aforementioned expression
Threshold - value to measure against said reduciton output to see if an alert should be triggered
Verify expression value and enter reduction and threshold values in line with your alerting expectation
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252F611NcMK333zBdgHQUxrX%252FScreen%2520Shot%25202023-04-16%2520at%252019.05.21.png%3Falt%3Dmedia%26token%3D39c103f8-8977-43d0-99f2-a968be0a36ca&width=768&dpr=4&quality=100&sign=985498ae&sv=1)
Select folder - if needed you can navigate to dashboard tab in left nav and create new folder
Select evaluation ground or type text in order to create a new group as shown below
![](https://docs.groundcover.com/~gitbook/image?url=https%3A%2F%2F2771001740-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252FUHgqKYgCiRKdOpWQdi52%252Fuploads%252F7xOiedPdEKwFnTTo7b4u%252FScreen%2520Shot%25202023-04-16%2520at%252019.26.03.png%3Falt%3Dmedia%26token%3Da9dcab02-ce46-415a-b208-0f882f233add&width=768&dpr=4&quality=100&sign=ff801f44&sv=1)
Click "Save and Exit" on top right hand side of screen to create alert
Ensure your notification is configured to have alerts sent to end users. See "Configuring Slack Contact Point" section below if needed.
Note:
Make sure to test the alert to ensure that it is working as expected. You can do this by triggering the conditions that you defined and verifying that the alert is sent to the specified notification channels.
Last updated