Analytics alerts
Analytics alerts are available to selected accounts. Contact your Coralogix account representative to request access. Accounts without it do not see Analytics in the alert type list.
An analytics alert runs a DataPrime query on a schedule and alerts on its result. Use it when the other alert types cannot express what you need to watch: a value you compute yourself, a join across fields, or a condition that only makes sense after an aggregation.
The other alert types start from a signal and give you a fixed shape. An analytics alert starts from a query, so the alert is only as specific as the query you write.
What you need
- Early access to analytics alerts for your account.
ALERTS:LOGSREADCONFIGto view analytics alerts, andALERTS:LOGSUPDATECONFIGto create and edit them. Analytics alerts use the log alert permissions.- A DataPrime query that returns the value you want to watch. See DataPrime.
Two types
Select Analytics in the alert type list, then select how it fires:
| Type | Fires when |
|---|---|
| Threshold | The tracked value crosses the level you set over a time frame. |
| Result Count | The number of rows the query returns crosses the count you set within a time frame. |
The type you select appears on the alert and in the Type filter of the alert list as Analytics - Threshold or Analytics - Result Count. Result Count replaces the earlier Immediate type: an existing Immediate alert is shown as a Result Count alert with one more than 0 condition, so it still fires whenever the query returns a row.
Create an analytics alert
-
Select Alerts, then Create alert.
-
In Alert type, select Analytics, then Threshold or Result Count.
-
Under Query, write your DataPrime query, for example:
source logs| filter $l.applicationname == 'checkout'| groupby $d.service:string as service aggregate count() as eventsThe example reads the default logs dataset, but you are not limited to it. You can query any dataset that is available to you as the user creating the alert. If the query omits
source, it reads the default logs dataset, so the example above behaves the same without its first line. -
Select the Tracked value. This is the column from the query result the alert watches,
eventsin the example above. Required for a threshold alert. -
For a threshold alert, check how the query groups its results. The alert's group-by keys come from the columns the query groups by,
servicein the example above, and the alert evaluates each combination of their values separately. A query withoutgroupbyis evaluated as one series. There's no separate option to set. Result Count alerts have no grouping. -
Set the Condition, then continue to Response and Summary.
Group-by keys
An analytics alert can group by up to 20 keys. A query that groups by more shows An alert supports up to 20 group-by keys, but this query groups by the number of keys, and you can't continue until you narrow it. Run still works, so you can check the query's results.
Existing analytics alerts keep evaluating as before until someone opens and saves them. When you open one, the wizard shows the group-by keys its query has now. When you save it, its grouping follows the query:
- If the alert didn't alert per row before but its query has a
groupby, it now alerts separately for each group. - If the alert alerted per row before but its query has no
groupby, it now evaluates as one series, and a Separate cases setting becomes Combined case.
Notifications
Analytics alerts notify through Cases only. Alerts still appears in the Notify on step, but it is disabled, with a tooltip saying alert notifications are not available for analytics alerts.
Condition
A threshold alert's condition reads as a sentence: Evaluate over a time frame of a period, then Alert when tracked value is an operator and a number, with a priority. The number can be negative, for example -10.
Add further rules with Add condition to raise the priority as the value gets worse. Thresholds must get stricter as priority increases, so every rule can fire.
A Result Count alert's conditions share one time frame, Each condition counts rows within the past a period. Each condition reads When the query rows count is an operator and a whole number, with a priority, for example When the query rows count is more than 30 within the past 15 minutes. Add up to five conditions, one for each priority. All conditions use the same operator. The alert's drilldown chart plots the evaluated row count, with a threshold line for each condition.
Evaluation frequency
Evaluation frequency controls how often the alert engine runs your query, separately from the time frame the query covers. You can find it in the Condition section of the Configuration step, below the condition rules: Alert engine checks data every a number of minutes. Enter a whole number from 1 to 1440. The default is 10.
Shorter intervals detect issues sooner but consume more query resources. Use frequent evaluation only for alerts that need near real-time detection.
The frequency can be longer than the time frame. In that case, the editor warns that data between evaluations isn't checked and events may be missed.
Evaluation frequency and the time frame are independent. An alert evaluating every minute over a 10-minute frame re-reads the same 10 minutes of data every minute, overlapping each time.
Evaluation delay
If you do not set an evaluation delay, analytics alerts use a default of 5 minutes.
Missing data behavior
When there is no data decides what the alert reports when the query returns nothing: Set OK treats the absence as healthy, so the alert does not fire on a gap.
Auto retire sets how long a value the query stops returning stays on the alert before it is dropped. Without it, an instance that disappears from the results keeps its last state indefinitely.
Limits
The query has a 30-second timeout. If it takes longer to run, the alert does not evaluate. The drilldown chart marks those evaluations in its status bar, and its legend shows Timed out. See Alert drill-down.
An analytics alert that groups by one or more keys creates one instance per combination of values, and the combinations are capped at 10,000. Adding a group-by key multiplies the combinations, so a key with many distinct values can exceed the cap on its own. The editor warns before you save and names the maximum each field can carry.
A separate, lower limit applies to the chart rather than to evaluation: above 1,000 group-by permutations the drilldown chart is unavailable. The alert still evaluates normally.
Next steps
- Select what the alert notifies on, and route it, in Configure notifications.
- Compare the alert types in Introduction to alerts.
