Prometheus Blackbox Exporter

Kevin FOO
2 min readApr 19, 2023

How to setup and run a Prometheus Blackbox exporter in few seconds.

Assuming you have Docker Desktop already installed in your Mac, if not read macOS Install Docker Desktop I previously wrote. The below command will pull blackbox exporter container from the internet if you run for the first time else you do not need an internet connectivity.

docker run --rm -p 9090:9115 --name blackbox_exporter prom/blackbox-exporter

What the params means?

run
Run the container with Docker

--rm
Remove and clean the container on exit

-p 9115:9115
Binds port 9090 to the container's port 9115.
To run on port 9115, use -p 9115:9115

--name blackbox_exporter
Name the running container as blackbox_exporter

prom/blackbox-exporter
Pulls docker image from prom/blackbox-exporter

Let’s say I would like to check if the website https://checkip.amazonaws.com is up and listening at port 443. Visit the below URL like below.

http://localhost:9090/probe?target=checkip.amazonaws.com:443&module=tcp_connect

If up and running healthily probe_success will show the value of 1.

< Back to all the stories I had written

--

--

Kevin FOO

A software engineer, a rock climbing, inline skating enthusiast, a husband, a father.