With USQL metric events, you can extract business-level KPI metrics from your user session and user action data and store these metrics as time series. You can then use the stored metrics in custom charts, alerting mechanisms, or Metrics API.
USQL metric events are available as:
uscm.
prefix.uacm.
prefix.User action metric events are available since Dynatrace version 1.260.
USQL metric events can help you answer questions such as:
You can create and manage USQL metric events using either the Dynatrace web UI or the Dynatrace Settings API.
You can create and manage USQL metric events using the Dynatrace web UI.
uscm.
prefix.uacm.
prefix.COUNT(*)
when using USQL.COUNT(*)
when using USQL.Alternatively, you can use USQL to create USQL metric events.
You can also use the Settings API to configure USQL metric events.
Create an access token with the Write settings (settings.write
) and Read settings (settings.read
) permissions.
Use the GET a schema endpoint to learn the JSON format required to post your configuration.
Use the POST an object endpoint to send your configuration.
The table below explains all configuration properties required to create or update a USQL custom metric via API.
Property
Description
Possible values
enabled
Defines if the USQL custom metric is enabled or not. Set to false
to temporarily disable the metric.
true
or false
metricKey
The metric key used when ingesting the metric. Use this key when requesting the metric data via Data Explorer.
uscm.
prefix.uacm.
prefix.value
The source of the metric value.
value.type
COUNT(*)
when using USQL, set to COUNTER
.FIELD
.COUNTER
or FIELD
value.fieldName
If value.type
=FIELD
, specifies the name of the user session or user action field.
dimensions
Lists the fields used as dimensions.
filters
Specifies filters.
filter.fieldName
Specifies the name of the filter field.
filter.operator
Specifies the operator.
EQUALS
, NOT_EQUAL
, IS_NULL
, IS_NOT_NULL
, LIKE
, LESS_THAN
, LESS_THAN_OR_EQUAL_TO
, GREATER_THAN
, GREATER_THAN_OR_EQUAL_TO
filter.value
Provides the second argument for binary operators (such as EQUALS
or GREATER_THAN
).
Check the sections below to view the lists of supported values, dimensions, and filters for user session metric events.
usersession.
prefix in the field name is optional. For example, usersession.duration
and duration
mean the same thing.null
, the metric is ignored, but Dynatrace uses self-monitoring to identify those cases.duration
numberOfRageClicks
numberOfRageTaps
totalErrorCount
totalLicenseCreditCount
userActionCount
longProperties.*
1
doubleProperties.*
1
Any custom long or double property, for example, longProperties.outerwidth
or doubleProperties.revenue
usersession.
prefix is optional. For example, usersession.country
and country
mean the same thing. When ingesting the metric, the usersession.
prefix is dropped, for example, usersession.country
becomes country
.useraction.
prefix is mandatory. When ingesting the metric, the useraction.
prefix persists.null
, Dynatrace uses the null
string as a dimension value.useraction.application
as a dimension and a user session spans multiple applications, the value of the user session custom metric is recorded for each application. To avoid the value appearing as double-counted, split the metric by application.appVersion
applicationType
bounce
browserFamily
browserMajorVersion
browserType
carrier
region
continent
country
connectionType
device
displayResolution
endReason
hasCrash
hasError
hasSessionReplay
manufacturer
networkTechnology
newUser
osFamily
osVersion
reasonForNoSessionReplay
reasonForNoSessionReplayMobile
rootedOrJailbroken
screenHeight
screenOrientation
screenWidth
userExperienceScore
userType
stringProperties.*
1
Any custom string property, for example, stringProperties.author
. Use fields with low cardinality to avoid creating too many dimension values.
useraction.application
1
Supported starting with Dynatrace version 1.234
usersession.
prefix is optional. For example, usersession.country
and country
mean the same thing.useraction.
prefix is mandatory.AND
.ANY
.appVersion
applicationType
bounce
browserFamily
browserMajorVersion
browserMonitorName
browserType
carrier
city
region
continent
country
connectionType
device
displayResolution
duration
endReason
hasCrash
hasError
hasSessionReplay
ip
isp
manufacturer
networkTechnology
newUser
numberOfRageClicks
osFamily
osVersion
reasonForNoSessionReplay
reasonForNoSessionReplayMobile
rootedOrJailbroken
screenHeight
screenOrientation
screenWidth
totalErrorCount
totalLicenseCreditCount
userActionCount
userExperienceScore
userId
userType
longProperties.*
1
doubleProperties.*
1
stringProperties.*
1
Any custom long, double, or string property, for example, longProperties.outerwidth
, doubleProperties.revenue
, or stringProperties.author
useraction.apdexCategory
useraction.application
useraction.cdnBusyTime
useraction.cdnResources
useraction.customErrorCount
useraction.domCompleteTime
useraction.domContentLoadedTime
useraction.documentInteractiveTime
useraction.domain
useraction.duration
useraction.firstInputDelay
useraction.firstPartyBusyTime
useraction.firstPartyResources
useraction.frontendTime
useraction.hasCrash
useraction.internalApplicationId
useraction.internalKeyUserActionId
useraction.javascriptErrorCount
useraction.keyUserAction
useraction.largestContentfulPaint
useraction.name
useraction.networkTime
useraction.requestErrorCount
useraction.serverTime
useraction.speedIndex
useraction.targetUrl
useraction.thirdPartyBusyTime
useraction.thirdPartyResources
useraction.type
useraction.visuallyCompleteTime
Expand the sections below to explore supported values, dimensions, and filters for user action metric events.
useraction.
prefix is optional. For example, useraction.type
and type
mean the same thing.usersession.
prefix is required.null
, the metric is ignored, but Dynatrace uses self-monitoring to identify those cases.speedIndex
duration
networkTime
serverTime
frontendTime
documentInteractiveTime
firstPartyResources
firstPartyBusyTime
thirdPartyResources
thirdPartyBusyTime
cdnResources
cdnBusyTime
domCompleteTime
domContentLoadedTime
loadEventStart
loadEventEnd
visuallyCompleteTime
requestStart
responseStart
responseEnd
userActionPropertyCount
customErrorCount
javascriptErrorCount
requestErrorCount
largestContentfulPaint
firstInputDelay
totalBlockingTime
deprecated
cumulativeLayoutShift
longProperties.*
1
doubleProperties.*
1
Any custom long or double property
usersession.duration
usersession.numberOfRageClicks
usersession.numberOfRageTaps
usersession.totalErrorCount
usersession.totalLicenseCreditCount
usersession.userActionCount
usersession.longProperties.*
1
usersession.doubleProperties.*
1
Any custom long or double property, for example, usersession.longProperties.outerwidth
or usersession.doubleProperties.revenue
useraction.
prefix is optional. For example, useraction.type
and type
mean the same thing. When ingesting the metric, the useraction.
prefix is dropped, for example, useraction.type
becomes type
.usersession.
prefix is required. When ingesting the metric, the usersession.
prefix persists.null
, Dynatrace uses the null
string as a dimension value.application
hasCrash
type
apdexCategory
internalApplicationId
internalKeyUserActionId
keyUserAction
isEntryAction
isExitAction
stringProperties.*
1
Any custom string property. Use fields with low cardinality to avoid creating too many dimension values.
usersession.appVersion
usersession.applicationType
usersession.bounce
usersession.browserFamily
usersession.browserMajorVersion
usersession.browserType
usersession.carrier
usersession.region
usersession.continent
usersession.country
usersession.connectionType
usersession.device
usersession.displayResolution
usersession.endReason
usersession.hasCrash
usersession.hasError
usersession.hasSessionReplay
usersession.manufacturer
usersession.networkTechnology
usersession.newUser
usersession.osFamily
usersession.osVersion
usersession.reasonForNoSessionReplay
usersession.reasonForNoSessionReplayMobile
usersession.rootedOrJailbroken
usersession.screenHeight
usersession.screenOrientation
usersession.screenWidth
usersession.userExperienceScore
usersession.userType
usersession.stringProperties.*
1
Any custom string property, for example, usersession.stringProperties.author
. Use fields with low cardinality to avoid creating too many dimension values.
useraction.
prefix is optional. For example, useraction.type
and type
mean the same thing.usersession.
prefix is required.AND
.apdexCategory
application
cdnBusyTime
cdnResources
customErrorCount
cumulativeLayoutShift
domCompleteTime
domContentLoadedTime
documentInteractiveTime
domain
duration
firstInputDelay
firstPartyBusyTime
firstPartyResources
frontendTime
hasCrash
internalApplicationId
internalKeyUserActionId
isEntryAction
isExitAction
javascriptErrorCount
keyUserAction
largestContentfulPaint
loadEventStart
loadEventEnd
name
networkTime
requestErrorCount
requestStart
responseStart
responseEnd
serverTime
speedIndex
targetUrl
thirdPartyBusyTime
thirdPartyResources
totalBlockingTime
deprecated
type
userActionPropertyCount
visuallyCompleteTime
syntheticEvent
longProperties.*
1
doubleProperties.*
1
stringProperties.*
1
Any custom long, double, or string property
usersession.appVersion
usersession.applicationType
usersession.bounce
usersession.browserFamily
usersession.browserMajorVersion
usersession.browserMonitorName
usersession.browserType
usersession.carrier
usersession.city
usersession.region
usersession.continent
usersession.country
usersession.connectionType
usersession.device
usersession.displayResolution
usersession.duration
usersession.endReason
usersession.hasCrash
usersession.hasError
usersession.hasSessionReplay
usersession.ip
usersession.isp
usersession.manufacturer
usersession.networkTechnology
usersession.newUser
usersession.numberOfRageClicks
usersession.numberOfRageTaps
usersession.osFamily
usersession.osVersion
usersession.reasonForNoSessionReplay
usersession.reasonForNoSessionReplayMobile
usersession.rootedOrJailbroken
usersession.screenHeight
usersession.screenOrientation
usersession.screenWidth
usersession.totalErrorCount
usersession.totalLicenseCreditCount
usersession.userActionCount
usersession.userExperienceScore
usersession.userId
usersession.userType
usersession.longProperties.*
1
usersession.doubleProperties.*
1
usersession.stringProperties.*
1
Any custom long, double, or string property, for example, usersession.longProperties.outerwidth
, usersession.doubleProperties.revenue
, or usersession.stringProperties.author
We've identified the following limitations for USQL metric events:
DISTINCT
keyword used in USQL is not supported. If you have a query like SELECT COUNT(DISTINCT country) from usersession
, it is not possible to create an equivalent USQL custom metric.To better understand how USQL metric events work, you can follow the tutorial for user session metric events below.
Create a metric
Create and pin a chart
Create an alert
Using the Dynatrace web UI, let's create an Average session duration user session custom metric (USCM) based on the session data of real users. The metric will include two dimensions for segmentation of session data by browser family and major browser version. Using this metric, we will then create a chart for the metric, pin the chart to a dashboard, and create a custom event for the metric so that you can receive alerts when the metric value exceeds a specified threshold.
uscm.average_duration_of_sessions_by_browser_family_and_version
as Metric key.duration
.browserMajorVersion
and browserFamily
dimensions.userType
= REAL_USER
(Field name is userType
, Operator is equals
, and Value is REAL_USER
)useraction.application
= www.easytravel.com
(Field name is useraction.application
, Operator is equals
, and Value is www.easytravel.com
). Instead of using the www.easytravel.com
value, you can use the name of your own application.Now you have a user session custom metric that is extracted as a field (duration
) only when useraction.application
equals www.easytravel.com
(filtering for a specific application) and userType
is REAL_USER
(filtering for real users only). Additionally, you have added two dimensions that allow you to split data based on the browser family or major browser version.
Once the user session data is received and the metric is populated, you can chart this metric, pin the chart to a dashboard, and even create an alert based on the metric.
Now let's create a chart based on the uscm.average_duration_of_sessions_by_browser_family_and_version
metric and pin this chart to one of your dashboards.
Go to Data Explorer.
Select the uscm.average_duration_of_sessions_by_browser_family_and_version
metric, and select Run query.
Using Data Explorer, split the collected data to see the user session data partitioned based on browserMajorVersion
, browserFamily
, or both.
Filter user session data based on browserMajorVersion
or browserFamily
to focus on the user session data that interests you.
Once you create a chart presenting your data, you can pin the chart to a classic dashboard: select Pin to dashboard, select one of your dashboards, and enter the tile name.
As the last part of this example, we'll create an alert based on the user session metric events.
To create an alert
uscm.average_duration_of_sessions_by_browser_family_and_version
metric. For details, see Metric events.Make sure the user session is not live. Dynatrace extracts and stores metric data to time series only after a user session is closed.
As sessions are closed in applications, they are pushed to the queue for later processing. A number of background workers then extract metric data from the user sessions to prepare the data for metric ingestion.
Synthetic user session data is not factored into USQL metric events.
Exclude synthetic sessions from your query. Also, check that the same timeframe is applied to the query and metric.
Starting with Dynatrace 1.232, USQL metric events are subject to the Davis data unit (DDU) licensing. These metrics are billed as regular schemaless metrics.
To estimate the cost per metric, the sessions for the last 7 days are evaluated and the cost in DDUs per metric is calculated according to the expected ingestion per minute. For details, see How do we calculate DDU consumption for metric events?.
The Dynatrace metric-data persistence follows a data-retention strategy that aggregates metrics over time. The data-retention strategy applied to USQL metric events is identical to the data-retention strategy used for built-in time series metrics.
For details, see Data retention periods > Metrics