An uptime monitoring service that monitors the health of a website or an API endpoint.
This project is inspired by coding challenge #78 by John Crickett's coding challenges.
This project is a spring boot application designed to monitor health of a website or an API endpoint by periodically making a request to the endpoint and record its response. The service supports the following features:
- Providing a detailed structure of the endpoint including request body, parameters and expected response body and response status code.
- Supports GET, HEAD and POST requests.
- Configure request frequency for the endpoint monitoring.
- Scheduler that runs every minute and periodically makes a request to the endpoint as per the request frequency.
- Record responses if actual response status code does not match the expected response status code.
- Record responses if actual response latency is more than minimum response latency, if configured.
- Monitoring the uptime and response times of critical services.
- Ensuring APIs meet service-level agreements (SLAs).
- Identifying and alerting on failures or degraded performance.
Run the application using:
./mvnw spring-boot:run
Endpoints APIs can be accessed via /v1/endpoints
.
Below is the example for a POST endpoint request:
{
"url": "https://www.google.com",
"name": "Google",
"method": "HEAD",
"responseCode": 200,
"requestFrequencyInMunites": 1
}
Failure responses can be accessed via GET /v1/endpoints/{endpointId}/failure-responses
.
Latency responses can be accessed via GET /v1/endpoints/{endpointId}/latency-responses
.
- Spring Boot: For application development and scheduling.
- Spring Data JPA: For database access and entity management.
- Hibernate: As the ORM framework.
- MySQL: As the database.
- Flyway: For managing migrations.
- RestTemplate: For making HTTP requests to monitored endpoints.
- SLF4J: For logging and diagnostics.
- Add support for real-time notifications via email or messaging services.
- Provide a dashboard for visualizing uptime and performance metrics.
- Extend to support more protocols, such as gRPC or WebSocket endpoints.