Ensuring applications and services are accessible and performant is the #1 priority of any software development and operations teams. Outages and performance issues in applications and services can result in loss of customer trust and customer drop-offs. Proactive monitoring of applications and services is the only way for devops teams to identify issues and resolve them before the customers are impacted.

What is Synthetic Monitoring?

Synthetic monitoring is a monitoring methodology that emulates end-user behavior to ensure the critical application functionality is working consistently. The set up process involves pre-creating test scripts that are scheduled to be executed at regular intervals or triggered on new deployments to ensure the test scenarios are working as expected and application is performant. If the automated test scripts encounter any issues while running the test scripts, alerts would automatically be created so the problem can be investigated and resolved before a customer runs into that issue.

Types of Tests

There are broadly two types of synthetic monitoring tests:

  • Browser Tests
  • API Tests

Browser Tests are used for monitoring browser based application functionality. The test involves launching a browser to simulate a real user behavior interacting with the application for performing specific tasks or operations. Many popular frameworks such as Selenium, Playwright, Puppeteer etc. can be used to create automated browser tests. Typically browser tests are slow and fragile (depending on the framework), however they test the entire application stack.

API Tests are used to verify that APIs exposed for an application are functional and performant. Most modern applications heavily rely on REST APIs for development of Web applications, mobile apps and integrations. API tests are much faster to execute and stable, however they only test specific functionality of your overall application.

Tests can be executed from multiple geo-locations to simulate real users accessing the application and ensure that user experience is acceptable with higher network latencies.

How can it help?

Synthetic Monitoring can help monitor more than just uptime for the application:

  • Application uptime and availability to ensure that critical user paths using your applications/services are available and functional.
  • Application performance to ensure that API response times are within acceptable limits and critical flows are performant and usable for users.
  • Application errors and failing network requests that your potential end-users encounter can be traced.

Monitoring Strategies

Synthetic monitoring can be a great tool for engineering teams. Here are a few strategies for using synthetic monitoring:

  • Scheduled Tests are tests that are set up to be executed at regular intervals. A typical example scenario is - Try login every 5 minutes. These tests ensure that the critical application flows in production are working as expected.
  • Triggered Execution are tests that are executed via CI/CD pipeline on deployment of a new build. For example, once a new build is deployed to Production or Staging - a set of tests can be triggered to be executed to identify potential regression issues
  • Integration Tests that integrate with multiple systems/services can be executed at regular intervals to identify potential issues, outages or bottlenecks.

Synthetic Monitoring vs. Real User Monitoring

Real User Monitoring(RUM) is another monitoring strategy that involves tracing application behavior when a real-user is using the application. The RUM strategies involve collecting logs, recording browser sessions, capturing analytics when a real-user is using the application. However, with Real User Monitoring(RUM) any potential issues are identified only after a customer encounters them and the error is captured during the interaction.

Since RUM always traces the transactions in the context of a real customer performing the operation, there can be potential privacy implications. RUM requires proper processes and access controls must be in place and oftentimes, the privacy and legal reviews to set up RUM can delay the process. However, in Synthetic monitoring there will never be real-user data, the tests are always executed with demo or test user accounts.

How can DevRaven help?

DevRaven offers synthetic monitoring capabilities to run both browser tests and API tests from multiple geo-locations. Tests can be scheduled to be automatically executed as per defined schedule or can also be executed via remote triggers from the build process. An alert will automatically be sent for any browser test or API test failures. We support sending alerts via Email, Slack, Microsoft Teams and popular incident response tools like PagerDuty and Opsgenie.

We support Playwright framework for setting up browser tests, which can be executed on all popular browsers. Tests can be created in multiple ways including an easy to use DevRaven Recorder that helps quickly record the test scenario. Tests can also be created using no-code editor that allows just selecting the browser actions from a catalog of supported actions.

DevRaven Recorder

API Tests can be set up using a simple and easy-to-use interface similar to any REST client. No code assertions can be set up to validate HTTP Response codes, headers, payloads and also response times.

For complex end-to-end user scenarios, we support setting up Collections that can execute Browser or API test steps with optional delay between steps.

Conclusion

Setting up synthetic monitoring is the easiest way for software development teams to ensure that their application or services are available and performant. Potential regressions or performance issues can be identified before those issues are encountered by a real customer. Engineering teams can avoid frustrating customer escalations with proactive monitoring of their applications.