Mobile app metrics API - POST a metric

  • Reference
  • Published Apr 16, 2020

Creates a new calculated mobile app metric.

The request consumes and produces an application/json payload.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/mobile
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/calculatedMetrics/mobile

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

ParameterTypeDescriptionInRequired
bodyCalculatedMobileMetric

The JSON body of the request. Contains the definition of the new calculated metric for mobile or custom app.

bodyoptional

Request body objects

The CalculatedMobileMetric object

Definition of the calculated metric for mobile or custom app.

ElementTypeDescriptionRequired
applicationIdentifierstring

The Dynatrace entity ID of the application to which the metric belongs.

required
dimensionsCalculatedMobileMetricDimension[]

A list of metric dimensions.

optional
enabledboolean

The metric is enabled (true) or disabled (false).

required
metricKeystring

The unique key of the metric.

The key must have the calc:apps prefix.

required
metricTypestring

The type of the metric.

  • REPORTED_ERROR_COUNT
  • USER_ACTION_DURATION
  • WEB_REQUEST_COUNT
  • WEB_REQUEST_ERROR_COUNT
required
namestring

The name of the metric, displayed in the UI.

required
userActionFilterCalculatedMobileMetricUserActionFilter

User actions filter of the calculated metric for mobile or custom app.

optional

The CalculatedMobileMetricDimension object

Dimension of the calculated mobile metric.

ElementTypeDescriptionRequired
dimensionstring

The dimension of the metric.

  • APP_VERSION
  • DEVICE
  • ERROR_CONTEXT
  • GEOLOCATION
  • MANUFACTURER
  • OS
required
topXinteger

The number of top values to be calculated.

required

The CalculatedMobileMetricUserActionFilter object

User actions filter of the calculated metric for mobile or custom app.

ElementTypeDescriptionRequired
actionDurationFromMillisecondsinteger

Only actions with a duration more than or equal to this value (in milliseconds) are included in the metric calculation.

optional
actionDurationToMillisecondsinteger

Only actions with a duration less than or equal to this value (in milliseconds) are included in the metric calculation.

optional
apdexstring

Only actions with the specified Apdex score are included in the metric calculation.

  • Frustrated
  • Satisfied
  • Tolerating
  • Unknown
optional
appVersionstring

Only actions coming from this app version are included in the metric calculation.

The EQUALS operator applies.

optional
carrierstring

Only actions coming from this carrier type are included in the metric calculation.

optional
citystring

Only actions of users from this city are included in the metric calculation.

Specify geolocation ID here.

optional
connectionTypestring

Only actions coming from this connection type are included in the metric calculation.

  • LAN
  • MOBILE
  • OFFLINE
  • UNKNOWN
  • WIFI
optional
continentstring

Only actions of users from this continent are included in the metric calculation.

Specify geolocation ID here.

optional
countrystring

Only actions of users from this country are included in the metric calculation.

Specify geolocation ID here.

optional
devicestring

Only actions coming from this app version are included in the metric calculation.

The EQUALS operator applies.

optional
hasHttpErrorboolean

The HTTP error status of the actions to be included in the metric calculation:

  • true: Only actions with HTTP errors are included.

  • false: All actions are included.

optional
hasReportedErrorboolean

The error status of the actions to be included in the metric calculation:

  • true: Only actions with reported errors are included.

  • false: All actions are included.

optional
ispstring

Only actions coming from this internet service provider are included in the metric calculation.

The EQUALS operator applies.

optional
manufacturerstring

Only actions coming from devices of this manufacturer are included in the metric calculation.

The EQUALS operator applies.

optional
networkTechnologystring

Filter by network technology

optional
orientationstring

Only actions coming from devices with this display orientation are included in the metric calculation.

  • LANDSCAPE
  • PORTRAIT
  • UNKNOWN
optional
osFamilystring

Only actions coming from this OS family are included in the metric calculation.

Specify the OS ID here.

optional
osVersionstring

Only actions coming from this OS version are included in the metric calculation.

Specify the OS ID here.

optional
regionstring

Only actions of users from this region are included in the metric calculation.

Specify geolocation ID here.

optional
resolutionstring

Only actions coming from devices with this display resolution are included in the metric calculation.

  • CGA
  • DCI2K
  • DCI4K
  • DVGA
  • FHD
  • FWVGA
  • FWXGA
  • GHDPlus
  • HD
  • HQVGA
  • HQVGA2
  • HSXGA
  • HUXGA
  • HVGA
  • HXGA
  • NTSC
  • PAL
  • QHD
  • QQVGA
  • QSXGA
  • QUXGA
  • QVGA
  • QWXGA
  • QXGA
  • SVGA
  • SXGA
  • SXGAMinus
  • SXGAPlus
  • UGA
  • UHD16K
  • UHD4K
  • UHD8K
  • UHDPlus
  • UNKNOWN
  • UWQHD
  • UXGA
  • VGA
  • WHSXGA
  • WHUXGA
  • WHXGA
  • WQSXGA
  • WQUXGA
  • WQVGA
  • WQVGA2
  • WQVGA3
  • WQXGA
  • WQXGA2
  • WSVGA
  • WSVGA2
  • WSXGA
  • WSXGAPlus
  • WUXGA
  • WVGA
  • WVGA2
  • WXGA
  • WXGA2
  • WXGA3
  • WXGAPlus
  • XGA
  • XGAPLUS
  • _1280x854
  • nHD
  • qHD
optional
userActionNamestring

Only actions with this name are included in the metric calculation.

The EQUALS operator applies.

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.

{
"applicationIdentifier": "MOBILE_APPLICATION-1234",
"dimensions": [
{
"dimension": "GEOLOCATION",
"topX": 20
}
],
"enabled": true,
"metricKey": "calc:apps.mobile.mymetric",
"metricType": "USER_ACTION_DURATION",
"name": "MyMetric",
"userActionFilter": {
"country": "GEOLOCATION-1234",
"hasHttpError": true,
"osVersion": "OS-1234"
}
}

Response

Response codes

CodeTypeDescription
201EntityShortRepresentation

Success. The calculated mobile metric has been created. Response contains its key and name.

400ErrorEnvelope

Failed. The input is invalid

Response body objects

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

ElementTypeDescription
descriptionstring

A short description of the Dynatrace entity.

idstring

The ID of the Dynatrace entity.

namestring

The name of the Dynatrace entity.

Response body JSON model

{
"description": "Dynatrace entity for the REST API example",
"id": "6a98d7bc-abb9-44f8-ae6a-73e68e71812a",
"name": "Dynatrace entity"
}

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.

POSTSaaShttps://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/mobile/validator
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/config/v1/calculatedMetrics/mobile/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

CodeTypeDescription
204-

Validated. The submitted metric is valid. The response doesn't have a body.

400ErrorEnvelope

Failed. The input is invalid.