Skip to content

Latest commit

 

History

History

blackbox-exporter

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Blackbox prober exporter sandbox

In this sandbox, the Blackbox prober exporter probes a simple web service, while Prometheus scrapes probe_* metrics from the Blackbox exporter.

Usage

To start the sandbox:

# In the foreground
make run # docker-compose up --build

# In detached mode
make run-detached # docker-compose up --build --detach

This will start up three services:

Service Description
blackbox A Prometheus Blackbox exporter running on port 9115, which runs probes against the web service using the http_2xx module.
prometheus A Prometheus instance configured to scrape the Blackbox exporter and collect a wide variety of metrics (prefaced by probe_).
web A simple web service with two endpoints: /hello returns a {"hello": "world"} JSON object and /health returns an HTTP 200 OK indicating that the service is running. The web service

Things to check out:

At first, the web service will be running normally, which means that the Blackbox probes of that service's /health will succeed. This will change if you shut down the service:

docker-compose stop web

Now you can navigate back to the most recent probe result and see that probe_success now has a value of 0. If you navigate back to the Prometheus expression browser you can see that probe_success for the web service now returns 0 as well (the scrape interval is 5 seconds, so you may need to wait a bit and hit refresh).

If you restart the web service, the probes will once again be successful:

docker-compose start web

Assets

Folder Assets
prometheus A prometheus.yml configuration file for Prometheus
blackbox A blackbox.yml configuration file for the Blackbox exporter
web Source files for the simple web server (written in Go)