Rules describe the criteria that must be met to trigger an alert. Alerts can be of any of the following severities - an info, a warning or a critical message or custom alerts for additional categories. You can set different criteria for each of these categories.
Rules in Analytics is a feature that is not available by default. If you would like to enable the optional rules feature in Analytics, please contact support@netspring.io.
This section will help you get started with defining simple rules and alerts. Following are 2 concepts that you need to be familiar with before you start creating rules.
What are condition states?
'OK' means any data point which does not conform to any provided condition, otherwise it has that condition's state.
What is Alert Generation Policy?
Any data point that is non-OK is a candidate to trigger an alert. This can be very noisy as contiguous bad states often indicate the same problem, or some outliers may cause false positives. To avoid large number of alerts, alert generation policy can be tuned to configure when an alert should be triggered, and when it should be finalized.
Enabling Rules for your Application and Setting Execution Time
Before you can begin creating rules, you need to enable the feature for your app. Following are the steps you need to follow to enable rules.
- On the left navigation panel in Analytics, click Settings.
- Under Application Settings, enable the toggle under Rules.
- Then, set the Refresh Cron Schedule. Rules are executed periodically based on the provided cron expression. Note that executions must have a period of one hour or more.
Creating a Rule
Now that you have enabled the Rules feature for your application, you can start creating new rules to trigger alerts. To create a new rule in Analytics:
- Click + on the left navigation panel and choose Rule.
- Inside the Rule section, you can configure your rule under the Rule Definition tab.
- First, choose a metric - here, as an example, we choose Total Time Viewed(TTV).
- Then, we specify the thresholds to flag alerts. In the example, let us set 2 conditions : a critical alert when the Total Time Viewed(TTV) is _less than or equal to 48000 _ and a warning when the Total Time Viewed(TTV) is _less than or equal to 55000 _. Choose different colors to differentiate each category of alert.
- You can also configure the Final Bound for your alerts. When you configure final bound, it means that when the value goes beyond a particular threshold, it will be considered as an OK state, meaning that no alerts will be triggered beyond that point. In our example, we set the configuration such that the final bound will be reached when the Total Time Viewed(TTV) is _less than or equal to 40000 _. You can add as many conditions as necessary and also choose a color of your choice for each category of alerts that you configure.
- When you click Alert Generation Policy, you will see the following fields:
-
- Generate for states - This field lets you define the states for which you want to generate alerts. Here, we set it to not in ok state.
- Open alert after - This field lets you configure when you want to trigger an alert. Here, we set it to 1 consecutive non-OK states.
- Finalize for states - This field lets you define the states which indicate that alert is over. Typically 'OK' states indicate finalization of alerts, but it can be any custom label defined above. Here, we set it to in ok state.
- Finalize alert after - This field lets you configure when you want alert to be over. Here, we set it to 1 consecutive OK states.
- If you want to add more grain to your alert configuratiion, you can also add Grouping Dimensions.
- It is also possible to add filters to your rules using the Add Filter option.
- Then, configure the Time Grain and Time Range for which you want to see a preview.
- Click Run Rule to see a simulated output of your rule. A graph of the metric appears over the specified time range. In addition, you can see a preview of the alerts that would be triggered.
If you want to create alerts for every data point satisfying one of the provided conditions instead of combining consecutive alerts together, you can set Finalize alert after to 0 consecutive OK states (the default is 1, which means that it waits for an OK state to finalize an alert).
- Save your rule. Once you save the rule, it can be enabled or disabled using the toggle at the top of your window.
Alert Template
You can customize the contents reported in the alert and the push notification. The Alert Template page helps you specify important details that should be in the title and description. You can also add custom fields to the alert to tailor the alerts to your business needs, or link to dashboards or URLs.
The Alert Template page shows the following:
- Alert customization options (on the left).
- A preview of the push notification on the phone (on the right).
The Alert Template page enables you to control the text in your alert's details. You can include 3 kinds of information in the alert's title or description:
- %Property - A property can be any pre-defined metadata about the alert, such as the alert's rule name or the alert status.
- Line Break - Add line breaks to format the information.
- Text - Add your own hardcoded strings.
Here is how you can customize your alert.
- Navigate to the Alert Template tab inside the Rules section.
- First, we configure the Title of the alert. The title will be displayed on the alert details screen and also in notifications. You can choose the elements that you want to add from the drop-down. Line Break, Property, and Text are the options that are currently available.
- Followed by this, you can add a description for your alert.
- It is also possible to link your alerts to dashboards or custom URLs to add more context on the issue.
Other Actions
Sharing a rule
To share a rule with other people within your organization,
- Click the Share icon at the top-right of your window.
- Enter the names of the users or groups you want to share the rule with and specify the access levels for each user.
- Click Invite.
Duplicating a rule
You can duplicate an existing rule by following the steps below:
- Click the three dots at the top-right of the window and click Save As.
- Add a name and description for the duplicate and choose the folder you want to add it to and click OK.
Deleting a rule
To delete a rule,
- Click the three dots at the top-right of the window and choose Delete.
- A dialog box appears asking you to confirm the deletion. Click Delete.
Please sign in to leave a comment.