What is Synthetic Monitor
A synthetic monitor in Dynatrace is a proactive feature that continuously tests the frontend of your application using an HTTP or endpoint URL. Synthetic monitors run from both public and private locations, simulating user interactions across different geographies. Since it's impractical to manually verify frontend availability from every location worldwide, synthetic monitoring automates this process, ensuring consistent performance and uptime.
What is the Dynatrace Environment API
The Dynatrace Environment API is a RESTful interface that allows developers and SREs to interact with their Dynatrace environment programmatically. It enables automation of tasks like retrieving synthetic monitors, pushing configurations, and extracting metrics. This API is ideal for managing observability workflows across Non-Prod and Prod environments. It supports secure access using API tokens with scoped permissions. By using the Environment API, teams can streamline monitoring, reduce manual effort, and ensure consistency across deployments.
Synthetic Monitor Migration Steps
Here we are migrating the Synthetic Monitor from Non Prod to Prod Environment.
Pre-requsites
- Create API Access Token with scopes (Read & Write Synthetic Monitors: V1) in both Non Prod and Prod Environment.
Procedure
- Open the Synthetic Monitor in Non Prod Environment and Copy the Monitor ID in the URL as Shown below.
- Navigate to Dynatrace Environment API V1 in Non Prod Environment and Authorise with API Access Token. After that, open the Synthetic - Monitors (Manage Synthetic Monitor) section. Click on GET, paste the Synthetic Monitor ID, and fetch the JSON response Body.
- Copy and save the JSON response body in Notepad or a Word Doc
- Remove the tags section in the JSON script and Attributes, if any, in the Square Brackets [] in automatically assigned apps [] as shown below
- Navigate to Dynatrace Environment API V1 in Prod Environment and Authorise with Prod API Access Token. After that, open the Synthetic - Monitors (Manage Synthetic Monitor) section. Click on POST
- Once you click on POST and paste the JSON script that you have modified.
- Once you paste the JSON script, hit Execute. If the process went well, you will see a 200 response code followed by the Migrated Monitor ID as below.
- Copy the Monitor ID and check it in the Prod Environment to see if it is available or not
- Add the tags on the Synthetic Monitor that you have removed in the JSON script
- Now you have successfully migrated the Synthetic Monitor from Non Prod to Prod Environment
If you want to watch the complete process, please watch below YouTube Video