Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve synthetic monitoring and alerting of RPC methods #3789

Open
givp opened this issue Jun 18, 2021 · 2 comments
Open

Improve synthetic monitoring and alerting of RPC methods #3789

givp opened this issue Jun 18, 2021 · 2 comments
Assignees
Labels
devops Developer Operations high priority high priority issue with customer impact mainnet rpc RPC or API

Comments

@givp
Copy link

givp commented Jun 18, 2021

Using AWS synthetic canary tests, we can simulate typical user experiences as it relates to RPC request and response flows. This will not only allow us to monitor response times but will also allow us to perform regression testing by ensuring response schemas are in tact and accurate returned values are present. Refer to this issue for a list of methods to be tested.

  1. Go to AWS > Cloudwatch > Synthetics > Canaries
  2. Create a new Canary and select "API Canary" blueprint

Image 2021-06-18 at 4 32 04 PM png

3. Add a new HTTP request

Image 2021-06-18 at 4 35 19 PM png

4. Add request URL, headers, and request body. Make sure to select "Capture headers and response body"

Image 2021-06-18 at 4 37 37 PM png

5. Using the script editor, use Javascript to inspect the response. For example, ensure a 2xx status code is returned and inspect the response payload to ensure certain fields are present and they match expected results.

Image 2021-06-18 at 4 40 31 PM png

6. Specify the frequency of your test

Image 2021-06-18 at 4 44 05 PM png

7. Finally, enable alarms for when success rates or endpoint response times fall below/above an acceptable threshold

Image 2021-06-18 at 5 14 16 PM png

You can now use the alarm like any other Cloudwatch alarm. It can trigger an email, send a message to PagerDuty and update https://status.harmony.one

@givp givp self-assigned this Jun 18, 2021
@givp givp added devops Developer Operations high priority high priority issue with customer impact mainnet rpc RPC or API labels Jun 18, 2021
@LeoHChen LeoHChen pinned this issue Jun 22, 2021
@LeoHChen
Copy link
Contributor

I tried it once to create a canary to test one RPC API. This is super nice.

@LeoHChen
Copy link
Contributor

We can open a bounty to use either AWS CLI or CloudFormation to build a complete RPC monitoring hub using canary automation. The list of RPC calls can be found in https://api.hmny.io

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
devops Developer Operations high priority high priority issue with customer impact mainnet rpc RPC or API
Projects
None yet
Development

No branches or pull requests

2 participants