Synthetic monitoring APIs introduced in v22.5, their prerequisites, and use cases to make the most of them
As of May 2022, AppDynamics Synthetic monitoring features can now be accessed using REST APIs. This article lists these new APIs, as well as a selection of use cases.
In this article...
New Synthetic monitoring APIs
Overview: Use cases with the new Synthetic monitoring APIs
Integrate Synthetic jobs with code repositories
Integrate a synthetic script from a code repository
Use Synthetic monitoring APIs to manage code centrally
Implement use cases
Integrate synthetic jobs with CI/CD pipeline
Implement use case
Additional Resources
New Synthetic monitoring APIs
WEB MONITORING
Create Synthetic Web Monitoring Job
Create Multiple Synthetic Web Monitoring Jobs
Update Synthetic Web Monitoring Job
Get Synthetic Web Monitoring Job Configuration Data
Get All Synthetic Web Monitoring Jobs
Get Synthetic Web Monitoring Job Execution Status
API MONITORING
Create Synthetic API Monitoring Job
Create Multiple Synthetic API Monitoring Jobs
Update Synthetic API Monitoring Job
Get Synthetic API Monitoring Job Configuration Data
Get All Synthetic API Monitoring Jobs
Get Synthetic API Monitoring Job Execution Status
Use cases with the new Synthetic monitoring APIs
Using these REST APIs, customers can implement new use cases and scenarios that are not otherwise supported within the AppDynamics Controller UI.
Following are a few of the new use cases that can be implemented using the Synthetic monitoring APIs
Integrate Synthetic jobs with code repositories
Integrate Synthetic jobs with CI/CD pipeline
Execute Synthetic jobs in multiple environments - Test, Pre-prod, Production
Apart from these use cases, Synthetic monitoring APIs can be used to implement these features:
Manage the Synthetic jobs from code repositories/central location
Manage the Synthetic jobs using APIs without logging into AppDynamics Controller
Bulk creation and management of Synthetic jobs
Schedule maintenance window
Analyze license consumption by job/app/collection
Let's explore in detail how these new use cases can be implemented.
Back to Top
Integrate Synthetic jobs with code repositories
Scenario 1 | Integrate a synthetic script from a code repository
Synthetic web monitoring scripts are created using any 3rd-party script recorder, or by writing Python-based selenium scripts. After creating the scripts, they are stored in code repositories. From there, the scripts are copied and pasted into AppDynamics job editor for creating Synthetic monitoring jobs.
When these synthetic web monitoring scripts need updating, modification, or debugging, they are copied from AppDynamics jobs editor and pasted into a Python IDE for updating or debugging scripts. It is hard to maintain the same code base in both the code repository and the AppDynamics jobs editor because of this repeated copy/pasting.
With Synthetic monitoring APIs, the scripts in the code repositories can be integrated with the Synthetic monitoring jobs in AppDynamics, thereby avoiding multiple copies and versions of each script. Any changes required in a script can be updated in the code repository, and then updated in the AppDynamics jobs using the Synthetic monitoring APIs.
Scenario 2 | Use synthetic monitoring APIs to manage code centrally
A Synthetic monitoring application can have multiple jobs. Job configurations (such as browsers, locations, execution schedule, execution frequency, etc.) are configured for each job during job creation.
Making configuration changes to these job configurations across all the jobs in an application is not possible from the AppDynamics Controller. There, since the configurations can only be changed for a single job at time, it is difficult to manage the (jobs) configuration when the application has several jobs.
Instead of managing job configurations at the job level in AppDynamics Controller UI, the configuration can be stored and managed centrally from a code repository using Synthetic monitoring APIs.
Back to Top
How can I implement either use case?
Let's explore in detail how these scenarios can be implemented:
Prerequisites, Create a job
Prerequisites to integrating Synthetic jobs with code repositories
Synthetic monitoring jobs scripts are stored in code repository
Job configurations are stored in a JSON file in the code repository
Job configuration is the list of all the parameters required for creating a job. The script used in the job could be part of the jobs configuration, or it could be stored in a separate file and referenced in the job configuration. Each job should have the job configuration data.
Job configuration of each job could be stored in separate files, or
The job configurations of all the jobs in the application could be stored in a single JSON file.
Create a job using the following execution steps
This job must be triggered whenever there is a commit in the code repository where the jobs scripts and jobs configurations are stored.
Check whether any job needs to be created
Get the job configurations data from the code repository
Check whether each job configuration has a job ID
NOTE | All jobs created in AppDynamics will have a job ID
Create job If any job configuration in code repository does not have a job ID:
Create a new job in AppDynamics using Create Synthetic job API or create multiple jobs APIs
Update the job id received in the response from create API in the jobs configuration in code repository
Check whether any jobs need to be updated If job ID exists for any job, check to see if it needs to be updated:
Use the Get Synthetic job configuration data API to fetch the the jobs configuration from AppDynamics
Compare all parameters of the job configuration in Appdynamics with the corresponding parameters in the job configuration in code repository
Update job If the job configuration of a job in the code repository does not match the same job's job configuration in AppDynamics, update the Synthetic job in AppDynamics using update Synthetic job API.
Back to Top
Integrate Synthetic jobs with CI/CD pipeline
Whenever a new code is deployed in the production, DevOps Engineers want to ensure that the application is available and performant. If the newly deployed code has any availability or performance issues, DevOps might want to roll back or pause the deployment.
Using Synthetic monitoring APIs, DevOps Engineers can monitor the availability and performance of the application or microservices as part of the deployment pipeline. Based on the Synthetic monitoring availability and performance data gathered as part of the deployment pipeline, a DevOps Engineer can automate deployment decisions such as continuing, pausing, or rolling back the deployment, etc.
How can I implement this use case?
Let's explore how this use case can be implemented.
Prerequisites for integrating Synthetic jobs with CI/CD pipeline
Synthetic monitoring jobs are available for the application or microservices.
CI/CD pipelines are available for the deployment of the application or the microservice.
Create a job with the following execution steps
The job must be triggered after the successful deployment of the application or microservice.
Start the Synthetic monitoring jobs using the Update Synthetic monitoring jobs API. To start the Synthetic monitoring job, set the value of "userEnabled" parameter in the job configuration “true”.
Monitor the availability and performance of the jobs using Get job status API. Get the job status every minute or based on the frequency of the job execution.
Deployment decision/action based on Synthetic monitoring jobs status.
Availability issue and job status
Deployment actions
Availability issue with job status Failed
Roll back the deployment
Create alerts, PD or Zendesk ticket
Availability issue with job status Warning
Pause further deployment
Create alerts, PD or Zendesk ticket
Application available with job status OK for a specific duration
Continue the deployment or complete the deployment process/steps.
After completing the deployment, stop the Synthetic monitoring using Update Synthetic monitoring jobs API. Set the value of the "userEnabled" parameter in the job configuration to “false” to stop the Synthetic monitoring job.
Back to Top
Additional Resources
In the Documentation Portal
Synthetic Monitoring API
In the Knowledge Base
Synthetic API Monitoring APIs
Changes to Synthetic monitoring browsers
... View more