Synthetic metrics API - POST a metric

Creates a new calculated synthetic metric.

The request consumes and produces an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/calculatedMetrics/synthetic
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/synthetic

Authentication

To execute this request, you need the Write configuration (WriteConfig) permission assigned to your API token. To learn how to obtain and use it, see Authentication.

Parameters

Parameter Type Description In Required
body CalculatedSyntheticMetric

The JSON body of the request. Contains definition of the new calculated synthetic metric.

body optional

The CalculatedSyntheticMetric object

Definition of the calculated synthetic metric.

Element Type Description Required
monitorIdentifier string

The Dynatrace entity ID of the synthetic monitor to which the metric belongs.

required
name string

The name of the metric, displayed in the UI.

required
metricKey string

The unique key of the metric.

The key must have the calc:synthetic prefix.

required
enabled boolean

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

required
metric string

The type of the synthetic metric.

The metric element can hold these values.
required
dimensions SyntheticMetricDimension[]

A list of metric dimensions.

optional
filter SyntheticMetricFilter optional

The SyntheticMetricFilter object

Filter of the calculated synthetic metric.

Element Type Description Required
actionType string

Only user actions of the specified type are included in the metric calculation.

The actionType element can hold these values.
optional
hasError boolean

The execution status of the monitors to be included in the metric calculation:

  • true: Only failed executions are included.

  • false: All executions are included.

optional
errorCode integer

Only executions finished with the specified error code are included in the metric calculation.

optional
event string

Only the specified browser clickpath event is included in the metric calculation.

Specify the Dynatrace entity ID of the event here. You can fetch the list of clickpath events of the monitor with the GET a synthetic monitor request from the Environment API

optional
location string

Only executions from the specified location are included in the metric calculation.

Specify the Dynatrace entity ID of the location here. You can fetch the list of locations the monitor is running from with the GET a synthetic monitor request from the Environment API.

optional

The SyntheticMetricDimension object

Dimension of the calculated synthetic metric.

Element Type Description Required
topX integer

The number of top values to be calculated.

optional
dimension string

The dimension of the metric.

The dimension element can hold these values.
required

Possible values

Possible values for the actionType element in the SyntheticMetricFilter object:

  • Custom
  • Load
  • Xhr

Possible values for the dimension element in the SyntheticMetricDimension object:

  • Event
  • Location
  • ResourceOrigin

Possible values for the metric element in the CalculatedSyntheticMetric object:

  • ApplicationCache
  • Callback
  • DNSLookup
  • DOMComplete
  • DOMContentLoaded
  • DOMInteractive
  • FailedRequestsResources
  • FirstContentfulPaint
  • FirstInputDelay
  • FirstInputStart
  • FirstPaint
  • HTMLDownloaded
  • HttpErrors
  • JavaScriptErrors
  • LargestContentfulPaint
  • LoadEventEnd
  • LoadEventStart
  • NavigationStart
  • OnDOMContentLoaded
  • OnLoad
  • Processing
  • RedirectTime
  • Request
  • RequestStart
  • ResourceCount
  • Response
  • SecureConnect
  • SpeedIndex
  • TCPConnect
  • TimeToFirstByte
  • TotalDuration
  • TransferSize
  • UserActionDuration
  • VisuallyComplete

Response format

The EntityShortRepresentation object

The short representation of a Dynatrace entity.

Element Type Description
id string

The ID of the Dynatrace entity.

name string

The name of the Dynatrace entity.

description string

A short description of the 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.

The request consumes an application/json payload.

Early Adopter

This request is an Early Adopter release and may be changed in non-compatible way.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/calculatedMetrics/synthetic/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/calculatedMetrics/synthetic/validator

Authentication

To execute this request, you need the Write configuration (WriteConfig) permission assigned to your API token. To learn how to obtain and use it, see Authentication.

Response codes

Code Description
204 Validated. The submitted calculated synthetic metric is valid. The response doesn't have a body.
400 Failed. The input is invalid.