
Building AWS Pulse: A Serverless Monitoring System on AWS
I built AWS Pulse, a serverless monitoring project using AWS Lambda, EventBridge, CloudWatch and SNS to monitor HTTP endpoints, measure availability and latency, detect outages and automatically send email alerts.
Building AWS Pulse: A Serverless Availability Monitoring System on AWS
Monitoring is one of those concepts that becomes much easier to understand when you actually build something.
Instead of only studying CloudWatch, Lambda, EventBridge and SNS separately, I wanted to connect these services into a real monitoring workflow.
That is how AWS Pulse started.
AWS Pulse is a personal serverless project that monitors HTTP endpoints, measures their availability and latency, stores metrics in Amazon CloudWatch and sends an email alert when a service becomes unavailable.
Note: AWS Pulse is the name of my personal project and is not an official Amazon Web Services product.
The idea
The goal was simple:
Can I build an automated monitoring solution on AWS without maintaining a dedicated monitoring server?
The system needed to:
- Check HTTP endpoints automatically
- Detect if a service is online or offline
- Measure response latency
- Generate logs
- Publish custom CloudWatch metrics
- Display information in a dashboard
- Detect failures using CloudWatch Alarms
- Send notifications through Amazon SNS
- Allow controlled failure simulations
For testing, I currently monitor two endpoints:
- A test API created specifically for AWS Pulse
Architecture
The main workflow is:
Amazon EventBridge Scheduler | v AWS Lambda monitor-function / \ / \ Google Test API | v Lambda Function URL
| v Amazon CloudWatch Metrics / Logs / Alarms | v Amazon SNS | v Email
The project runs in:
us-east-2 - US East (Ohio)
One of the things I liked about this architecture is that there is no monitoring VM running permanently.
Most of the system is event-driven.
Scheduling the monitoring
I used Amazon EventBridge Scheduler to execute the monitoring Lambda every five minutes.
There are currently two schedules:
aws-pulse-google-monitoraws-pulse-api
Both use:
rate(5 minutes)
Each schedule invokes the same Lambda function but sends a different target.
For example:
{ "target": "google"}
or:
{ "target": "api"}
The Lambda reads the target and decides which endpoint should be checked.
This allowed me to reuse the same monitoring logic instead of creating one Lambda function for every endpoint.
The monitoring Lambda
The core component is the
monitor-function .It is responsible for:
- Receiving the target from EventBridge
- Sending an HTTP GET request
- Measuring response time
- Reading the HTTP status code
- Determining availability
- Writing execution information to CloudWatch Logs
- Publishing custom CloudWatch metrics
I used Python with:
urllibtimeosboto3
I intentionally used
urllib instead of adding an external HTTP library because I wanted to keep the Lambda deployment simple.The monitoring logic interprets responses like this:
Response | Status | Availability |
|---|---|---|
HTTP 2xx | Online | 1 |
HTTP 3xx | Redirect / Available | 1 |
HTTP 4xx | Error | 0 |
HTTP 5xx | Offline | 0 |
Timeout / DNS / Network failure | Offline | 0 |
The availability metric is therefore very simple:
1 = Available0 = Unavailable
Creating a controlled failure
Testing monitoring systems can be difficult when everything is working.
I did not want to wait for a real website to become unavailable just to test my alarm.
So I created an AWS Pulse Test API.
It is another Lambda function exposed through a Lambda Function URL.
Its behavior is controlled by an environment variable:
API_STATUS
When:
API_STATUS = UP
the API returns:
HTTP 200
When:
API_STATUS = DOWN
it returns:
HTTP 503
This gave me a simple way to simulate an outage.
I could manually change the API to
DOWN and then observe the entire monitoring workflow reacting to the failure.Custom metrics with CloudWatch
The monitoring Lambda publishes metrics to a custom CloudWatch namespace:
AWS-Pulse
The main metrics are:
AvailabilityLatencyMs
I also use:
ServiceName
as a dimension.
This allows CloudWatch to separate metrics for each monitored service.
For example:
GoogleAWS Pulse Test API
Availability
Availability represents the current status of the endpoint:
1 = UP0 = DOWN
LatencyMs
LatencyMs records how long the HTTP request takes to complete.With both metrics, I can see not only if a service is available but also how its response time changes over time.
Dashboard
I created an Amazon CloudWatch Dashboard to centralize the monitoring information.
It currently displays:
- Google availability
- Google latency
- Test API availability
- Test API latency
- CloudWatch Alarm states
- General AWS Pulse monitoring information
Having everything on one dashboard made it much easier to visualize what was happening during the failure simulations.
Detecting an outage
CloudWatch Alarms monitor the
Availability metric.The main condition is:
Availability < 1
When the value changes from:
1
to:
0
the alarm transitions from:
OK
to:
ALARM
I currently have separate alarms for the monitored endpoints.
Sending alerts with Amazon SNS
When a CloudWatch Alarm enters the
ALARM state, it triggers an Amazon SNS topic:aws-pulse-alerts
The SNS topic sends an email notification.
The alert flow becomes:
CloudWatch Metric | vCloudWatch Alarm | v Amazon SNS | v Email
This completed the monitoring cycle.
The system was no longer only collecting metrics — it could actually notify someone when a failure happened.
Testing the complete workflow
The most interesting part of the project was testing the entire architecture.
Under normal conditions:
API_STATUS = UPHTTP 200Availability = 1Alarm = OK
Then I changed the Test API to:
API_STATUS = DOWN
The API started returning:
HTTP 503
On the next EventBridge execution, the monitoring Lambda detected the failure and published:
Availability = 0
CloudWatch detected the metric change.
The alarm entered the
ALARM state.Amazon SNS was triggered.
And finally, the notification arrived by email.
The complete flow was:
Test API |HTTP 503 | vEventBridge Scheduler | vmonitor-function | vAvailability = 0 | vCloudWatch | vCloudWatch Alarm | vAmazon SNS | vEmail Alert
After returning the API to
UP , the next monitoring cycle detected HTTP 200 again and restored:Availability = 1
IAM permissions
The project also helped me practice IAM permissions between AWS services.
The monitoring Lambda needs permission to publish custom CloudWatch metrics using:
cloudwatch:PutMetricData
EventBridge Scheduler also uses an execution role with permission to invoke the monitoring Lambda:
lambda:InvokeFunction
No AWS credentials are stored inside the source code.
AWS services used
The project currently uses:
- AWS Lambda
- Amazon EventBridge Scheduler
- Amazon CloudWatch Logs
- Amazon CloudWatch Metrics
- Amazon CloudWatch Dashboard
- Amazon CloudWatch Alarms
- Amazon SNS
- AWS IAM
- Lambda Function URLs
Although AWS Pulse is a relatively small project, connecting these services together helped me understand much better how AWS event-driven architectures work in practice.
What I learned
The biggest lesson from this project was that observability is much more than creating a dashboard.
You need to think about the complete cycle:
Collect ↓Measure ↓Visualize ↓Detect ↓Alert ↓Recover
Building AWS Pulse allowed me to practice all of these stages.
It also helped reinforce concepts around:
- Serverless architecture
- Monitoring
- Observability
- Event-driven architecture
- HTTP status codes
- CloudWatch custom metrics
- CloudWatch alarms
- IAM permissions
- Incident detection
- Automation
What's next?
There are several improvements I would like to implement.
Some of them are:
- Dynamic endpoint configuration
- Latency thresholds
- Performance-specific alarms
- Slack or Microsoft Teams notifications
- Incident history
- SLA reporting
- Infrastructure as Code using Terraform or AWS SAM
- CI/CD for Lambda deployments
Another interesting improvement would be allowing endpoints to be added without modifying the Lambda code.
That would make the project much easier to scale.
Final thoughts
AWS Pulse started as a simple question:
How can I monitor an HTTP endpoint using only managed AWS services?
It became a complete serverless monitoring workflow capable of scheduling checks, measuring availability and latency, detecting outages and automatically sending notifications.
More importantly, building it helped me connect several AWS concepts that I had previously studied separately.
That is one of the things I enjoy most about cloud projects: you start with a small idea and end up learning how multiple services interact in a real architecture.
The source code and full project documentation are available on GitHub:
github.com/Victor-Djalma/aws-pulse
If you were evolving this architecture, what would you add next?
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article