Alerting with rules

  • Updated

In Optimizely Analytics, rules describe the criteria needed to trigger an alert. Alerts can be of any of the following severities – info, a warning, a critical message, or custom alerts for additional categories. You can set different criteria for each of these categories. 

Rules is not available by default. If you want to enable this optional feature in Analytics, contact support@netspring.io.

This section helps you define simple rules and alerts. You should be familiar with the following two concepts before creating a rule:

  • Condition states – The state OK means the data point does not conform to any provided condition. Otherwise, it has that condition's state.
  • Alert generation policy – Any data point that is not OK can trigger an alert. This can be noisy, as contiguous bad states often indicate the same problem, or some outliers may cause false positives. You can configure when an alert should be triggered and finalized to avoid many alerts.

Enable rules and set the execution time

Before creating rules, you must enable the feature.

  1. Click Settings > General Settings on the navigation panel and enable Rules.
  2. Set the Refresh Cron Schedule. Rules are executed periodically based on the provided cron expression. Executions must have a period of one hour or more.

    opti-alerts-1.gif

Create a rule

Users can create rules to trigger alerts when Rules are enabled.

opti-alerts-2.gif

To create a rule in Analytics:

  1. Click +Rule on the navigation panel.
  2. Configure the rule under the Rule Definition tab.
  3. Choose a metric – for example, Total Time Viewed(TTV).
  4. Specify the thresholds to flag alerts. For example, set two 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.
  5. Configure the Final Bound for the alerts so that when the value goes beyond a particular threshold, it is considered an OK state, meaning no alerts are triggered. In the example, set the configuration to reach the final bound when the Total Time Viewed(TTV) is less than or equal to 40000. You can add as many conditions as necessary and choose a color for each category of alerts configured.
  6. Click Alert Generation Policy, and it displays the following fields:
    • Generate for states – Define the states to generate alerts. Here, it is set to not in ok state.
    • Open alert after – Configure when to trigger an alert. Here, it is set to 1 consecutive non-OK state.
    • Finalize for states – Define the states indicating the alert is over. Typically, OK states indicate the finalization of alerts, but it can be any custom label defined previously. Here, it is set to in ok state. 
    • Finalize alert after – Configure when you want the alert to be over. Here, it is set to 5 consecutive OK states.

      opti-alerts-4.png

  1. Add Grouping Dimensions to add more grain to the alert configuration. You can add filters to rules using the Add Filter option.

    opti-alerts-3.png

  1. Click Run to see a simulated output of the rule—a graph of the metric displays over the specified time range. In addition, you can preview the alerts that would be triggered.

    opti-alerts-5.png

  1. Create alerts for every data point satisfying one of the provided conditions instead of combining consecutive alerts by setting the Finalize alert after field to zero consecutive OK states (the default is 1, which means it waits for an OK state to finalize an alert).

    opti-alerts-6.png

  1. Save the rule, which you can turn on or off using the toggle.

    opti-alerts-7.png

Alert Template

You can customize the content reported in the alert and the push notification. The Alert Template page helps specify important details in the title and description. Add custom fields to the alert to tailor it to your business needs or link to dashboards or URLs.

The Alert Template page shows the following:

  • Alert customization options
  • A preview of the push notification on the phone

The Alert Template page lets users control the text in the alert's details. You can include three types of information in the alert's title or description:

  • %Property – Add any pre-defined metadata about the alert, such as the alert's rule name or status.
  • Line Break – Add line breaks to format the information.
  • Text – Add your own hardcoded strings.

To customize an alert:

  1. Go to the Alert Template tab inside Rules.
  2. Configure the Title of the alert. The title is displayed on the alert details page and also in notifications. You can choose the elements you want to add from the drop-down list. Line BreakProperty, and Text are the options that are currently available.
  3. Add a description for the alert.
  4. Link alerts to dashboards or custom URLs to add more context to the issue.

    opti-alerts-8.gif

Other Actions

Share a rule

  1. Click Share.
  2. Enter the names of the users or groups with whom you want to share the rule and specify the access levels for each user.
  3. Click Invite.

    opti-alerts-9.png

Duplicate a rule

  1. Click MoreSave As.
  2. Add a name and description for the duplicate, choose a folder, and click OK.

    opti-alerts-10.png

Delete a rule

  1. Click More > Delete.
  2. Click Delete in the dialog to confirm the deletion.

    opti-alerts-11.png