Skip to content

chensxb97/endpointMonitoringService

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Endpoint Monitoring Service

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.

React Frontend

  • Dashboard for checking endpoint probe status
  • Input Form for sending endpoint records to our backend for storage

Usage

  1. Build Dependencies
cd frontend/ && npm install
  1. Run Frontend
npm run start
  1. You should be able to view the following pages: 1) Endpoint Status Dashboard, 2) Endpoint Onboarding Form.

Endpoint Status Dashboard

Dashboard

Endpoint Onboarding Form

Endpoint Onboarding Form

Go Backend

  • 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.

Usage

  1. Build Dependencies
go mod tidy
  1. Run Backend
make run

Blackbox Exporter

  • Performs probes and exports metrics on the statuses of the targets' probes

Usage

  1. Install the binary from here or clone the repo.

  2. Run Blackbox Exporter.

Running from Binary

./blackbox_exporter --config.file=./configs/blackbox.yml

Build and run manually

cd blackbox_exporter/ && go run main.go --config.file=./configs/blackbox.yml

Prometheus

  • Metric storage
  • Runs the prometheus job definition that fetches metrics from blackbox exporter

Usage

  1. Install the binary from here or clone the repo.

  2. Run Prometheus

Running from Binary

./prometheus --config.file=./configs/prometheus.yml

Build and run manually

cd prometheus/ && make build
./prometheus --config.file=./configs/prometheus.yml
  1. Validate targets
  • Ensure that the endpoints, labels that we have created via the UI are visible on the targets page: http://localhost:9090/targets. Prometheus Targets

  • Query your metrics via the Prometheus UI.

# Should return 1 for successful probe, 0 otherwise.
probe_success{instance='http://example.com'}

About

A POC for scalable onboarding of endpoints for blackbox exporter monitoring

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published