Synthetic monitors API - GET a monitor

Gets the properties of the specified monitor, including its JSON script.

GETSaaShttps://{your-environment-id}.live.dynatrace.com/api/v1/synthetic/monitors/{monitorId}
Environment ActiveGatehttps://{your-activegate-domain}:9999/e/{your-environment-id}/api/v1/synthetic/monitors/{monitorId}

Authentication

To execute this request, you need an access token with one of the following scopes:

  • ExternalSyntheticIntegration
  • ReadSyntheticData

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
monitorIdstring

The ID of the required synthetic monitor

pathrequired

Response

To find all model variations that depend on the type of the model, see JSON models.

Response codes

CodeTypeDescription
200SyntheticMonitor

Success

4XXErrorEnvelope

Client side error.

5XXErrorEnvelope

Server side error.

Response body objects

The SyntheticMonitor object

The synthetic monitor.

The actual set of fields depends the type of the monitor. Find the list of actual objects in the description of the type field or see Synthetic monitors API - JSON models.

ElementTypeDescription
anomalyDetectionAnomalyDetection

The anomaly detection configuration.

automaticallyAssignedAppsstring[]

A set of automatically assigned applications.

createdFromstring

The origin of a monitor

  • API
  • GUI
enabledboolean

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

entityIdstring

The entity ID of the monitor.

frequencyMininteger

The frequency of the monitor, in minutes.

You can use one of the following values: 5, 10, 15, 30, and 60.

locationsstring[]

A list of locations from which the monitor is executed.

To specify a location, use its entity ID.

managementZonesManagementZone[]

A set of management zones to which the monitor belongs to.

manuallyAssignedAppsstring[]

A set of manually assigned applications.

namestring

The name of the monitor.

scriptobject

The script of a browser or HTTP monitor.

tagsTagWithSourceInfo[]

A set of tags assigned to the monitor.

typestring

Defines the actual set of fields depending on the value. See one of the following objects:

  • BROWSER -> BrowserSyntheticMonitor
  • HTTP -> HttpSyntheticMonitor
  • BROWSER
  • HTTP

The AnomalyDetection object

The anomaly detection configuration.

ElementTypeDescription
loadingTimeThresholdsLoadingTimeThresholdsPolicyDto

Performance thresholds configuration.

outageHandlingOutageHandlingPolicy

Outage handling configuration.

The LoadingTimeThresholdsPolicyDto object

Performance thresholds configuration.

ElementTypeDescription
enabledboolean

Performance threshold is enabled (true) or disabled (false).

thresholdsLoadingTimeThreshold[]

The list of performance threshold rules.

The LoadingTimeThreshold object

The performance threshold rule.

ElementTypeDescription
eventIndexinteger

Specify the event to which an ACTION threshold applies.

requestIndexinteger

Specify the request to which an ACTION threshold applies.

typestring

The type of the threshold: total loading time or action loading time.

  • ACTION
  • TOTAL
valueMsinteger

Notify if monitor takes longer than X milliseconds to load.

The OutageHandlingPolicy object

Outage handling configuration.

ElementTypeDescription
globalOutageboolean

When enabled (true), generate a problem and send an alert when the monitor is unavailable at all configured locations.

globalOutagePolicyGlobalOutagePolicy

Global outage handling configuration.

localOutageboolean

When enabled (true), generate a problem and send an alert when the monitor is unavailable for one or more consecutive runs at any location.

localOutagePolicyLocalOutagePolicy

Local outage handling configuration.

Alert if affectedLocations of locations are unable to access the web application consecutiveRuns times consecutively.

retryOnErrorboolean

Schedule retry if browser monitor execution results in a fail. For HTTP monitors this property is ignored.

The GlobalOutagePolicy object

Global outage handling configuration.

ElementTypeDescription
consecutiveRunsinteger

Alert if all locations are unable to access the web application X times consecutively.

The LocalOutagePolicy object

Local outage handling configuration.

Alert if affectedLocations of locations are unable to access the web application consecutiveRuns times consecutively.

ElementTypeDescription
affectedLocationsinteger

The number of affected locations to trigger an alert.

consecutiveRunsinteger

The number of consecutive fails to trigger an alert.

The ManagementZone object

The configuration of a management zone.

ElementTypeDescription
idstring

The ID of the management zone.

namestring

The name of the management zone.

The TagWithSourceInfo object

Tag with source of a Dynatrace entity.

ElementTypeDescription
contextstring

The origin of the tag, such as AWS or Cloud Foundry.

Custom tags use the CONTEXTLESS value.

  • AWS
  • AWS_GENERIC
  • AZURE
  • CLOUD_FOUNDRY
  • CONTEXTLESS
  • ENVIRONMENT
  • GOOGLE_CLOUD
  • KUBERNETES
keystring

The key of the tag.

Custom tags have the tag value here.

sourcestring

The source of the tag, such as USER, RULE_BASED or AUTO

  • AUTO
  • RULE_BASED
  • USER
valuestring

The value of the tag.

Not applicable to custom tags.

Response body JSON model

{
"anomalyDetection": {
"loadingTimeThresholds": {
"enabled": true,
"thresholds": [
{
"eventIndex": 1,
"requestIndex": 1,
"type": "ACTION",
"valueMs": 1
}
]
},
"outageHandling": {
"globalOutage": true,
"globalOutagePolicy": {
"consecutiveRuns": 1
},
"localOutage": true,
"localOutagePolicy": {
"affectedLocations": 1,
"consecutiveRuns": 1
},
"retryOnError": true
}
},
"automaticallyAssignedApps": [
"string"
],
"createdFrom": "API",
"enabled": true,
"entityId": "string",
"frequencyMin": 1,
"locations": [
"string"
],
"managementZones": [
{
"id": "string",
"name": "string"
}
],
"manuallyAssignedApps": [
"string"
],
"name": "string",
"script": {},
"tags": [
{
"context": "AWS",
"key": "string",
"source": "AUTO",
"value": "string"
}
],
"type": "BROWSER"
}

Example

In this example, the request lists the parameters of the dynatrace.com monitor, which is a browser clickpath that navigates to https://www.dynatrace.com/ and signs up for a free trial.

The API token is passed in the Authorization header.

Curl

curl -X GET \
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/monitors/SYNTHETIC_TEST-0000000000025434 \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890'

Request URL

https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/monitors/SYNTHETIC_TEST-0000000000025434

Response body

{
"entityId": "SYNTHETIC_TEST-0000000000025434",
"name": "dynatrace.com",
"frequencyMin": 15,
"enabled": true,
"type": "browser",
"script": {
"type": "clickpath",
"version": "1.0",
"configuration": {
"device": {
"deviceName":"Desktop",
"orientation":"landscape"
}
},
"events": [
{
"type":"navigate",
"description":"Loading of \"http://www.dynatrace.com\"",
"url":"http://www.dynatrace.com",
"wait": {
"waitFor":"page_complete"
}
},
{
"type":"click",
"description":"click on \"Free trial\"",
"target": {
"locators": [
{
"type":"css",
"value":"a:contains(\"Free trial\"):eq(1)"
},
{
"type":"css",
"value":".btn:eq(1)"
},
{
"type":"css",
"value":"#content div div div div div div div p:nth-child(3) a"
},
{
"type":"css",
"value":"#content div.homepage-hero-wrapper div.gallery div.flickity-viewport div.flickity-slider div.gallery-cell div.section div.column p.cta--row a.btn:eq(0)"
}
]
},
"button": 0,
"wait": {
"waitFor":"page_complete"
}
}
{
"type":"click",
"description":"click on \"email\"",
"target": {
"locators": [
{
"type":"css",
"value":"input[type=\"email\"][name=\"email\"]:eq(0)"
},
{
"type":"dom",
"value":"document.forms[0][\"email\"]"
},
{
"type":"css",
"value":".inputfield:eq(0)"
},
{
"type":"css",
"value":"#content div div:nth-child(2) form:nth-child(9) input:nth-child(3)"
},
{
"type":"css",
"value":"#content div.section div.tile form.cta input.inputfield:eq(0)"
}
]
},
"button":0
},
{
"type":"keystrokes",
"description":"keystrokes on \"email\"",
"target":{
"locators":[
{
"type":"css",
"value":"input[type=\"email\"][name=\"email\"]:eq(0)"
},
{
"type":"dom",
"value":"document.forms[0][\"email\"]"
},
{
"type":"css",
"value":".inputfield:eq(0)"
},
{
"type":"css",
"value":"#content div div:nth-child(2) form:nth-child(9) input:nth-child(3)"
},
{
"type":"css",
"value":"#content div.section div.tile form.cta input.inputfield:eq(0)"
}
]
},
"textValue":"sample@sample.com",
"masked":false,
"simulateBlurEvent":true
},
{
"type":"click",
"description":"click on \"Start free trial\"",
"target":{
"locators":[
{
"type":"css",
"value":"input[type=\"submit\"]:eq(0)"
},
{
"type":"dom",
"value":"document.forms[0][19]"
},
{
"type":"css",
"value":".btn:eq(1)"
},
{
"type":"css",
"value":"#content div div:nth-child(2) form:nth-child(9) div:nth-child(22) input"
},
{
"type":"css",
"value":"#content div.section div.tile form.cta div.cta__formgroup input.btn:eq(0)"
}
]
},
"button":0,
"wait":{
"waitFor":"page_complete"
}
}
]
},
"locations": [
"GEOLOCATION-B69A5A40388CC698",
"GEOLOCATION-A9022AAFA0763F56"
],
"anomalyDetection": {
"outageHandling": {
"globalOutage": true,
"localOutage": false,
"localOutagePolicy": {
"affectedLocations": 1,
"consecutiveRuns": 3
}
},
"loadingTimeThresholds": {
"enabled": false,
"thresholds": []
}
},
"tags": [],
"managementZones": [
{
"id": "-7832237287622819191",
"name": "!!allSynthetic"
}
]
}

Response code

200