Duo Yao
3 min readApr 22, 2022

--

Monitoring User Onboarding using Synthetic Canaries

User onboarding is an essential part of user facing applications. It is a facade for showcasing application quality and plays a crucial role for gaining customer tractions. Being able to monitor this workflow and catching any failures before they are exposed is important.

Amazon Cloudwatch Synthetics is known for monitoring endpoints and APIs. The team developed a set of monitoring canaries for user onboarding leveraging the Cloudwatch Synthetic Canaries.

The Onboarding Flow

The onboarding flow can be illustrated with the diagram below. The workflow consists of creating the organization and creating the license.

The onboarding flow consisting of creating the organization and license

Creating Organization

Organization creation is started by an HTTP request from the customer relation vendor. The service handling this request then interacts with a series of downstream services to signup this onboarding user, creating the user settings and to generate authorization settings for this organization.

Creating License

The creating license request follows create organization request. There are also a number of downstream services, with one being creating a demo for the onboarding user.

The Monitoring Canaries

Following the AAA testing pattern, we can summarize the onboarding canaries as the following:

Arrangements

  • Preparing the onboarding user parameters (email, password) and organization parameters (organization name)
  • Preparing the license
  • Preparing HTTP authentication and authorization tokens (used by actions and assertion requests)
  • Cleaning up previously created resources

Actions

  • Sending HTTP request to create the organization
  • Sending HTTP request to create the license

Assertions

  • Sending HTTP request to get and verify user settings, this verifies if the user has been properly associated to this organization
  • Sending HTTP request to get and verify organization authorization settings (roles, entitlements)
  • Verifying user received signup email with MailSlurp API
  • Sending HTTP request to get and verify users demos has been properly created, this verifies if the license downstream services have been working properly

Develop the Canaries

We developed three canary scripts with respective to the three different license types. Also given each of the canary scripts are similar, we extracted the common libraries. The scripts are structured as below. The canary/ holds the entry points and the canary-lib/ holds the libraries.

Canary Structure

The `package.json` showing how above dependencies are managed:

Canary Entry Point

A canary entry point can be structured as below. This illustrates how the monitoring has been organized. (sensitive information has been masked out)

Implementing Functions

Get request that returns a record

Post Request that creates a record

Reading from AWS parameter store

Interacting with MailSlurp API

Summary

The reason for writing this article is for documentation to myself on using the AWS Synthetics library. Also to inspire readers of using the Synthetic Canaries to monitor their production environment.

--

--