LambStatus doesn’t support custom HTTP(S) endpoint monitoring out-of-the box. This guide describes how to set up serverless HTTP(S) monitoring with AWS Lambda and AWS CloudWatch. Monitoring data collected this way can be displayed in LambStatus. The guide uses the lambda-watchtower script but can easily be adapted to any custom monitoring script.
Before setting up monitoring, an IAM Role with the permissions to store CloudWatch metrics needs to be set up.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "cloudwatch:PutMetricData",
"Resource": "*"
}
]
}
Now the function that performs the HTTP(S) monitoring needs to be set up on Lambda.
index.js
from the lambda-watchtower GitHub repository into the Lambda script editor.Finally, CloudWatch needs to be configured to call the Watchtower Lambda function every five minutes.
{
"targets": [
{
"url": "https://www.example.com",
"name": "example.com"
}
],
"timings": ["readable", "total"],
"timeout": 5000,
"namespace": "Watchtower"
}
All available options are listed in the Watchtower README.
Wait until the monitoring script has been called at least once. You can now add the new metrics to your status page from the LambStatus admin page.