Web application metrics API - POST a metric
Creates a new calculated web application metric.
The request consumes and produces an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/calculatedMetrics/rum |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/rum | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/calculatedMetrics/rum |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | WebApplicationMetric | The JSON body of the request. Contains the descriptor of the new calculated web application metric. | body | required |
Request body objects
The WebApplicationMetric
object
Descriptor of the calculated web application metric.
Element | Type | Description | Required |
---|---|---|---|
applicationIdentifier | string | The Dynatrace entity ID of the application to which the metric belongs. | required |
dimensions | WebApplicationDimensionDefinition[] | A list of metric dimensions. | optional |
enabled | boolean | The metric is enabled ( | required |
metricDefinition | WebApplicationMetricDefinition | Definition of the web application metric. | required |
metricKey | string | The unique key of the metric. The key must have the | required |
name | string | The displayed name of the metric. | required |
userActionFilter | UserActionFilter | User actions filter of the calculated web application metric. Only user actions matching the provided criteria are used for metric calculation. A user action must match all the criteria. | optional |
The WebApplicationDimensionDefinition
object
Dimension of the calculated web application metrics.
Element | Type | Description | Required |
---|---|---|---|
dimension | string | The dimension of the metric.
| required |
propertyKey | string | The key of the user action property. Only applicable for the | optional |
topX | integer | The number of top values to be calculated. | required |
The WebApplicationMetricDefinition
object
Definition of the web application metric.
Element | Type | Description | Required |
---|---|---|---|
metric | string | The type of the web application metric.
| required |
propertyKey | string | The key of the user action property. Only applicable for | optional |
The UserActionFilter
object
User actions filter of the calculated web application metric.
Only user actions matching the provided criteria are used for metric calculation.
A user action must match all the criteria.
Element | Type | Description | Required |
---|---|---|---|
actionDurationFromMilliseconds | integer | Only actions with a duration more than or equal to this value (in milliseconds) are included in the metric calculation. | optional |
actionDurationToMilliseconds | integer | Only actions with a duration less than or equal to this value (in milliseconds) are included in the metric calculation. | optional |
apdex | string | Only actions with the specified Apdex score are included in the metric calculation.
| optional |
browserFamily | string | Only user actions coming from the specified browser family are included in the metric calculation. The EQUALS operator applies. | optional |
browserType | string | Only user actions coming from the specified browser type are included in the metric calculation. The EQUALS operator applies. | optional |
browserVersion | string | Only user actions coming from the specified browser version are included in the metric calculation. The EQUALS operator applies. | optional |
city | string | Only actions of users from this city are included in the metric calculation. Specify geolocation ID here. | optional |
continent | string | Only actions of users from this continent are included in the metric calculation. Specify geolocation ID here. | optional |
country | string | Only actions of users from this country are included in the metric calculation. Specify geolocation ID here. | optional |
customAction | boolean | The status of custom actions in the metric calculation:
| optional |
customErrorName | string | The custom error name of the actions to be included in the metric calculation. | optional |
customErrorType | string | The custom error type of the actions to be included in the metric calculation. | optional |
domain | string | Only user actions coming from the specified domain are included in the metric calculation. The EQUALS operator applies. | optional |
hasAnyError | boolean | The error status of the actions to be included in the metric calculation:
| optional |
hasCustomErrors | boolean | The custom error status of the actions to be included in the metric calculation:
| optional |
hasHttpErrors | boolean | The request error status of the actions to be included in the metric calculation:
| optional |
hasJavascriptErrors | boolean | The JavaScript error status of the actions to be included in the metric calculation:
| optional |
httpErrorCode | integer | The HTTP error status code of the actions to be included in the metric calculation. | optional |
httpErrorCodeTo | integer | Can be used in combination with | optional |
httpPath | string | The request path that has been determined to be the origin of an HTTP error of the actions to be included in the metric calculation. | optional |
ip | string | Only actions coming from this IP address are included in the metric calculation. The EQUALS operator applies. | optional |
ipV6Traffic | boolean | The IPv6 status of the actions to be included in the metric calculation:
| optional |
loadAction | boolean | The status of load actions in the metric calculation:
| optional |
osFamily | string | Only actions coming from this OS family are included in the metric calculation. Specify the OS ID here. | optional |
osVersion | string | Only actions coming from this OS version are included in the metric calculation. Specify the OS ID here. | optional |
realUser | boolean | The status of actions coming from real users in the metric calculation:
| optional |
region | string | Only actions of users from this region are included in the metric calculation. Specify geolocation ID here. | optional |
robot | boolean | The status of actions coming from robots in the metric calculation:
| optional |
synthetic | boolean | The status of actions coming from synthetic monitors in the metric calculation:
| optional |
targetViewGroup | string | Only actions on the specified group of views are included in the metric calculation. | optional |
targetViewGroupNameMatchType | string | Specifies the match type of the view group filter, e.g. using
| optional |
targetViewName | string | Only actions on the specified view are included in the metric calculation. | optional |
targetViewNameMatchType | string | Specifies the match type of the view name filter, e.g. using
| optional |
userActionName | string | Only actions with this name are included in the metric calculation. The EQUALS operator applies. | optional |
userActionProperties | UserActionPropertyFilter[] | Only actions with the specified properties are included in the metric calculation. | optional |
xhrAction | boolean | The status of XHR actions in the metric calculation:
| optional |
xhrRouteChangeAction | boolean | The status of route change actions in the metric calculation:
| optional |
The UserActionPropertyFilter
object
User action property filter.
Element | Type | Description | Required |
---|---|---|---|
from | number | Only actions that have a value greater than or equal to this are included in the metric calculation. Only applicable to numerical values. | optional |
key | string | The key of the action property we're checking. | optional |
matchType | string | Specifies the match type of a string filter, e.g. using Only applicable to string values.
| optional |
to | number | Only actions that have a value less than or equal to this are included in the metric calculation. Only applicable to numerical values. | optional |
value | string | Only actions that have this value in the specified property are included in the metric calculation. Only applicable to string values. | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
1{2 "applicationIdentifier": "APPLICATION-1234",3 "dimensions": [4 {5 "dimension": "GeoLocation",6 "topX": 207 }8 ],9 "enabled": true,10 "metricDefinition": {11 "metric": "UserActionDuration"12 },13 "metricKey": "calc:apps.web.mymetric",14 "name": "MyMetric",15 "userActionFilter": {16 "browserType": "BROWSER-1234",17 "country": "GEOLOCATION-1234",18 "loadAction": true19 }20}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | EntityShortRepresentation | Success. The metric has been created. Response contains its key and name. |
400 | ErrorEnvelope | Failed. The input is invalid. |
Response body objects
The EntityShortRepresentation
object
The short representation of a Dynatrace entity.
Element | Type | Description |
---|---|---|
description | string | A short description of the Dynatrace entity. |
id | string | The ID of the Dynatrace entity. |
name | string | The name of the Dynatrace entity. |
Response body JSON model
1{2 "description": "Dynatrace entity for the REST API example",3 "id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",4 "name": "Dynatrace entity"5}
Validate payload
We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.
The request consumes an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/config/v1/calculatedMetrics/rum/validator |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/rum/validator | |
Environment ActiveGate | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/calculatedMetrics/rum/validator |
Authentication
To execute this request, you need an access token with WriteConfig
scope.
To learn how to obtain and use it, see Tokens and authentication.
Response
Response codes
Code | Type | Description |
---|---|---|
204 | - | Validated. The submitted metric is valid. The response doesn't have a body. |
400 | ErrorEnvelope | Failed. The input is invalid. |