Skip to content

Background task to check the status of a given url. Exposes metrics using Prometheus to keep track of the evolution

Notifications You must be signed in to change notification settings

tonisanta/monitoring-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Monitoring service

This background task checks the status of a given URL. If the request takes longer than a specific timeout, is cancelled (and it's considered as a 499 status code).

For every request, we store some Prometheus metrics that will be helpful to create a dashboard to visualize the status and the evolution of the system. Metrics are exposed in http://localhost:port/metrics, port can be adjusted with --port=8080

Grafana overview

Run commands

Additionally, the server exposes the /exec endpoint that allows running any command. Once the command has been executed, creates a new annotation in the Grafana, this way you can track the evolution since that specific moment (in this dashboard we use a dashed blue line).

Grafana annotation

For example, we can see that the response time decreases after a restart of a specific service in our docker-compose.

Example request - POST http://localhost:port/exec

{
    "command": "docker compose restart"
}

Configuration

Flag Default Description
url https://google.com/ Url to monitor
token Non valid token Grafana API token
host http://localhost:3000 Grafana host
frequency 1m Status check frequency
timeout 30s Request timeout
port 8080 Port used by the server

About

Background task to check the status of a given url. Exposes metrics using Prometheus to keep track of the evolution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published