If you want to execute an analytics search repeatedly to monitor its value, you can create a metric from the search. The search will execute once per minute and report the results as a metric. You can create alerts on the metric in the usual way using Health Rules to trigger Policies and Actions.
You can create metrics for all Analytics event types - Browser, Mobile, Transaction, Log and Custom.
Although the metrics calculated by scheduled queries may have decimal point precision, we only save and report whole numbers.
You can create a metric from an analytics search for the functions shown in the following table. For a discussion of metric rollup types see Metric Data Resolution over Time.
|Function||Metric Rollup Type||Example|
|count(* | field_name)||sum||SELECT count( activeMacUsers) FROM dummyTransactions|
|sum||SELECT distinctcount(activeMacUsers) FROM dummyTransactions|
|sum||SELECT sum(responseTime)where userExperience = "NORMAL" FROM transactions|
|SELECT avg(responseTime) FROM transactions|
|SELECT min(responseTime) FROM transactions|
|SELECT max(responseTime) FROM transactions|
SELECT (count(activeMacUsers)) / (avg(activeWindowsUsers)) FROM dummyTransactions
SELECT (avg(responseTime)*2)/((avg(segments.transactionTime)+3)/2) FROM transactions
SELECT (sum(responseTime)*2)/(filter(sum(responseTime), where userExperience = "NORMAL") + 0.5) FROM transactions
Each side of the expression must be enclosed in parenthesis.
To create metrics from analytics searches, you need the following permissions:
- Manage Metrics permission
- View access to the default Analytics Application
For more information, see:
Creating an Analytics Metric
To create a metric:
- Working in the Analytics > Search editor, set the search criteria to select the appropriate data.
- Click Actions > Create Metric in the search action toolbar.
- In the popup window, give your metric a name and a description.
The name determines how the metric appears in the Metrics screen and the Metric Browser. Keep in mind:
- Metrics are truncated to whole values. So values less than one are truncated to zero. To work around this, you can multiply a numeric_field_name by a factor of 10, 100, 1000 and so on, depending on the level of decimal accuracy you need. We recommend that you add this factor into the metric display name so other users can understand what the metric represents, for example, Display Name = Metric (Factor 1000). In cases where the value is a percentage, and you convert by multiplying by 100, you probably don't need to put the factor in the metric name because it would be implicit (Metric %).
- Math operations are only supported inside the aggregation function. For example,
count(numeric_field_name * 10) from transactions.
Monitoring Analytics Metrics
For performance reasons, the scheduled queries used in analytics metrics can be disabled as follows:
- Queries are disabled if calling the Events Service results in any errors for ten consecutive times.
- Queries are not disabled if the Events Service is not reachable from the controller, such as during maintenance and upgrade windows.
- When the Controller is restarted, the queries which were previously disabled by the system due to consecutive failures are reenabled.
- User-disabled queries remain disabled even after the system is restarted.
To monitor the metric:
- Click Metrics in the left navigation bar.
The Metrics list appears.
- Edit or Delete metrics from here. If you see a status that says "Disable due to repetitive failures", you can re-enable it by clicking Edit and checking Enabled.
- To see the metric in the Metric Browser, click Metric Browser. For more details, see the section "Metric Data Point Details" in Metric Browser.