An end-to-end scalable and easy-to-maintain endpoint monitoring service, powered by Prometheus and Blackbox Exporter.
This project requires setting up 4 different components: 1) React Frontend, 2) Go Backend, 3) Blackbox Exporter, 4) Prometheus.
- Dashboard for checking endpoint probe status
- Input Form for sending endpoint records to our backend for storage
- Build Dependencies
cd frontend/ && npm install- Run Frontend
npm run start- You should be able to view the following pages: 1) Endpoint Status Dashboard, 2) Endpoint Onboarding Form.
- Receives endpoints from frontend, saving them in storage. For this example, I am keeping them in memory for simplicity.
- Caches the endpoints in regularly intervals.
- Exposes the cache through an API to be picked up by Prometheus using HTTP Service Discovery.
- Build Dependencies
go mod tidy- Run Backend
make run- Performs probes and exports metrics on the statuses of the targets' probes
Running from Binary
./blackbox_exporter --config.file=./configs/blackbox.ymlBuild and run manually
cd blackbox_exporter/ && go run main.go --config.file=./configs/blackbox.yml- Metric storage
- Runs the prometheus job definition that fetches metrics from blackbox exporter
Running from Binary
./prometheus --config.file=./configs/prometheus.ymlBuild and run manually
cd prometheus/ && make build
./prometheus --config.file=./configs/prometheus.yml- Validate targets
-
Ensure that the endpoints, labels that we have created via the UI are visible on the targets page:
http://localhost:9090/targets.
-
Query your metrics via the Prometheus UI.
# Should return 1 for successful probe, 0 otherwise.
probe_success{instance='http://example.com'}
