Skip to content
This repository has been archived by the owner on Mar 2, 2022. It is now read-only.

Commit

Permalink
feat: log alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Jan 26, 2022
1 parent b2ca245 commit 3f6005d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ The `gateway-read-test-lambda` aims to track the IPFS gateway performance over t

It uses the [nft.storage gateway](https://github.com/nftstorage/nft.storage/tree/main/packages/gateway), which keeps a record of the performance of each backend gateway it uses, as well as which gateways had successfully retrieved a given [CID](https://docs.ipfs.io/concepts/content-addressing/#identifier-formats).

## High level Architecture

![High level Architecture](./gw-read-test-alerts.png)

## Assumptions

For the gateway read test MVP there are a few assumptions in place and this lambda function will try to read a given CID from the gateway if:
Expand All @@ -21,9 +25,23 @@ Once we have the new CAR chunking in place where last sent CAR has the root, we
This project already comes with a script for build and deploy (which is also integrated with Github Actions). However it needs:
- Project creation in AWS
- It needs a role policy with S3 `s3:GetObject` and `s3:ListBucket` privilleges
- Runtime with Node.js 14.x
- Secrets setup in Repo secrets for automatic deploy
- Environment variables setup

## Alerts

We use Amazon CloudWatch to aggregate the generated lambda logs. Within CloudWatch metrics filters are setup to infer potential issues from the metrics. Amazon Simple Notification Service (SNS) will receive alerts from the metrics filters and publish them to subscribers (in this case an Opsgeanie email address).

Setup:
- Create opsgeanie email integration to receive AWS alerts and forward them to the team
- Create [SNS Topics](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/US_SetupSNS.html) for alerts with subscription from opsgeanie email integration
- `error-fetching-car` topic to track failed gateway reads of CARs
- Create CloudWatch metric filters:
- Error fetching CAR
- Success fetching CAR
- track strange response time variance

## What's next?

- CBOR
Expand Down
Binary file added gw-read-test-alerts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3f6005d

Please sign in to comment.