Related pages: |
This page describes how to create analytics metrics from scheduled queries.
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. The analytics metric list is searchable.
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 this table. See Metric Data Resolution over Time.
Function | Metric Rollup Type | Example | |
---|---|---|---|
count(* | field_name) | sum | SELECT count( activeMacUsers) FROM dummyTransactions | |
distinctcount(field_name) | average | SELECT distinctcount(activeMacUsers) FROM dummyTransactions | |
sum(numeric_field_name) | sum | SELECT sum(responseTime)where userExperience = "NORMAL" FROM transactions | |
avg(numeric_field_name) | average | SELECT avg(responseTime) FROM transactions | |
min(numeric_field_name) | average | SELECT min(responseTime) FROM transactions | |
max(numeric_field_name) | average | SELECT max(responseTime) FROM transactions | |
(exp1)/(exp2) | average | SELECT (count(activeMacUsers)) / (avg(activeWindowsUsers)) FROM dummyTransactions
|
You must have Manage Metrics permission and View access to Analytics to create metrics from analytics searches. See Analytics and Data Security and Transaction Analytics Permissions. |
count(numeric_field_name * 10) from transactions.
Timestamp metrics always aggregate events from the current minute because metrics are created for events published in the last minute.
If you have specified a value for the eventTimestamp
field, the timestamp value in the new metric uses an aggregation of events from the pickupTimestamp field.
For example, you set an eventTimestamp
for an event on a previous day. You then create a metric for the event today. The metric does not use your explicit eventTimestamp
because it is no longer from the current minute. The metric aggregates events using pickupTimestamp
. This ensures that the metric timestamp is based on the current minute because pickupTimestamp
cannot be explicitly changed.
See Analytics Events API.
When you create a query, produces a holistic metric. Because the queried data comes from different events, the Events Service has to retrieve this segmented data and stitch it together to produce a single metric. The Events Service waits for correlated events to arrive, where the maximum wait time depends on the event type:
The wait time resets when the Events Service finds a correlated event.
If an event arrives after the maximum wait time, the event is not stitched together correctly in your query. For example in the following query fieldA
and fieldB
are separate but correlated events:
select count(*) from transactions where fieldA = "foo" and fieldB = "bar" |
The Events Service finds fieldA
and waits 10 seconds for a correlated event. If fieldB
arrives 15 seconds after fieldA
, the Events Services does not correlate both events. The count metric is now inaccurate because the events are not connected.
For performance reasons, the scheduled queries used in analytics metrics can be disabled as follows:
To monitor the metric:
Search, edit, enable, disable, or delete metrics from the Metrics list.
|
To activate or deactivate metrics in a batch, select the corresponding rows in the grid and click the Enable or Disable button in the toolbar. Use Shift+ click or Command + click rows to select multiple rows.
If you see a status that says "Disabled due to repetitive failures", you can re-enable it by clicking Enable. |
To see the metric in the Metric Browser, click the Metric Browser. For more details, see the section Metric Data Point Details.
If the metric aggregation times out, your applications may not display the analytics metrics. As an administrator, you can specify the applications for which you want the Controller to retry metric aggregation.
|