- 100% Serverless
- Unlimited website monitoring
- Slack alerts only when status is changed
- SNS Topic Publish only on status change. SNS can send alerts via
- SMS/Text Message
- Push
- etc.
- Basic Cloudwatch Graphs and Metrics
- Docker support For development environment
- *Low cost monitoring
Below is quick cost estimation of using this tool. These are just sample cost estimation. Please note these prices cannot be used as a final or real price for using this tool and can vary depending on the configuration.
Please do your own research and check AWS pricing before using the tool.
- Paid tier
- Scheduler runs every 5 minutes
- Lambda function timeout set to 30 seconds
- Lambda function uses max 128 MB Memory
- Lambda number of request is 8640
- Lambda request duration is 30000 ms
- 500 Text Message (United States) per month
- 500 Email per month
- Cost is per month
# | Endpoints | Lambda Cost | Metrics | DynamoDB | SNS | Total |
---|---|---|---|---|---|---|
1 | 10 | $0.54 | $6 | $0 | $3.235 | $9.775 |
2 | 50 | $0.54 | $30 | $0 | $3.235 | $33.775 |
3 | 100 | $0.54 | $60 | $0 | $3.235 | $63.775 |
4 | 500 | $0.54 | $300 | $0 | $3.235 | $303.775 |
# | Endpoints | Lambda Cost | Metrics | DynamoDB | SNS | Total |
---|---|---|---|---|---|---|
1 | 10 | $0.54 | $0 | $0 | $3.235 | $3.775 |
2 | 50 | $0.54 | $0 | $0 | $3.235 | $3.775 |
3 | 100 | $0.54 | $0 | $0 | $3.235 | $3.775 |
4 | 500 | $0.54 | $0 | $0 | $3.235 | $3.775 |
- AWS Account
- nodeJs OR docker with docker-compose
- AWS CLI OR docker with docker-compose
- Serverless Framework OR docker with docker-compose
- Clone the repo locally
git clone [email protected]:akki-io/serverless-monitor.git
- Start the docker container
docker-compose up -d
- Install Dependencies
docker-compose exec node npm install
- Configure AWS CLI
docker-compose exec node aws configure
- Install Dependencies
npm install
- Configure AWS CLI
aws configure
Copy serverless-example.yml
to serverless.yml
cp serverless-example.yml serverless.yml
Configure a slack incoming webhook and update slackWebhookUrl
environment:
slackWebhookUrl: UPDATE_YOUR_SLACK_WEBHOOK HERE # https://slack.com/intl/en-ca/help/articles/115005265063-Incoming-Webhooks-for-Slack
If you want to disable cloud metrics set enableMetrics
to false
in serverless.yml
environment:
enableMetrics: false
Update your website/api urls under input
input:
- 'https://www.google.com'
- 'https://www.tekz.io'
- 'https://www.akki.io'
Once you have modified your serverless.yml
it is time to deploy the project to AWS.
docker-compose exec node serverless deploy --stage prod --region us-east-1
serverless deploy --stage prod --region us-east-1
This will deploy the project to us-east-1
Deployment Output
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service monitor.zip file to S3 (1.37 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
...........
Serverless: Stack update finished...
Service Information
service: monitor
stage: prod
region: us-east-1
stack: monitor-prod
resources: 9
api keys:
None
endpoints:
None
functions:
http: monitor-prod-http
layers:
None
Serverless: Run the "serverless" command to setup monitoring, troubleshooting and testing.
A quick look at the Resources created by AWS using CloudFormation
If you made changes to the serverless.yml
or added new inputs for website/API.
You can simply call this command to update the existing stack.
docker-compose exec node serverless deploy --stage prod --region us-east-1
serverless deploy --stage prod --region us-east-1
This tool creates a empty topic without any subscriptions attached. You can add your own subscriptions like email, SMS etc.
Invoke the cloud function
docker-compose exec node \
serverless invoke \
--stage prod --region us-east-1 --function http \
--data '["https://www.google.com"]'
Invoke the local copy of the function
docker-compose exec node \
serverless invoke local \
--stage prod --function http \
--data '["https://www.google.com"]'
Invoke the cloud function
serverless invoke \
--stage prod --region us-east-1 --function http \
--data '["https://www.google.com"]'
Invoke the local copy of the function
serverless invoke local \
--stage prod --function http \
--data '["https://www.google.com"]'
You will then see an output similar to below.
endpoints: [ 'https://www.google.com' ]
Requesting https://www.google.com
https://www.google.com : {"statusCode":200,"durationMS":229.07045600000015}
Final results:
{"https://www.google.com":{"statusCode":200,"durationMS":229.07045600000015}}
{
"https://www.google.com": {
"statusCode": 200,
"durationMS": 229.07045600000015
}
}
Logged metrics in Cloudwatch at: serverless-monitor
Slack Alerts
CloudWatch Graph
Text Alerts
Email Alerts
All contributions are welcomed, please create a Pull Request.
- lambda-ping - Inspiration
AWS SNS TopicEnable/Disable Metrics- Enable/Disable Slack
- Custom Success Status Code
Cost Estimation- ... suggestions?
Licensed under the MIT license.