Nomploy Nomad Packs

← All packs

blackbox-exporter v0.1.0

Observability

Prometheus Blackbox Exporter — probes endpoints over HTTP, HTTPS, TCP, DNS, and ICMP and exposes the results for Prometheus (uptime, latency, cert expiry). Deployed as a stateless host-networked Nomad service with a rendered module config. Pairs with the monitoring pack.

nomad-pack run blackbox-exporter --registry nomploy
1 task http 9115 image prom/blackbox-exporter:latest
Variables 8
values.hcl

Save as values.hcl, edit, then run:

nomad-pack run blackbox-exporter -f values.hcl --registry nomploy
# The name of the Nomad job.
job_name = "blackbox-exporter"

# The Nomad namespace to deploy into.
namespace = "default"

# The datacenters to deploy to.
datacenters = ["*"]

# The Prometheus Blackbox Exporter image. Pin a tag in production.
image = "prom/blackbox-exporter:latest"

# Host port for the exporter (/probe and /metrics).
port = 9115

# Full blackbox.yml contents (modules). The default provides http_2xx, tcp_connect, and icmp probers — extend it as needed.
config = <<-EOT
    modules:
      http_2xx:
        prober: http
        timeout: 5s
        http:
          preferred_ip_protocol: ip4
      tcp_connect:
        prober: tcp
        timeout: 5s
      icmp:
        prober: icmp
        timeout: 5s
  EOT

# Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
constraints = []

# The task resources.
resources = {
    cpu    = 200
    memory = 64
  }
NameTypeDefaultDescription
job_name string
"blackbox-exporter"
The name of the Nomad job.
namespace string
"default"
The Nomad namespace to deploy into.
datacenters list
["*"]
The datacenters to deploy to.
image string
"prom/blackbox-exporter:latest"
The Prometheus Blackbox Exporter image. Pin a tag in production.
port number
9115
Host port for the exporter (/probe and /metrics).
config string
<<-EOT
    modules:
      http_2xx:
        prober: http
        timeout: 5s
        http:
          preferred_ip_protocol: ip4
      tcp_connect:
        prober: tcp
        timeout: 5s
      icmp:
        prober: icmp
        timeout: 5s
  EOT
Full blackbox.yml contents (modules). The default provides http_2xx, tcp_connect, and icmp probers — extend it as needed.
constraints list
[]
Placement constraints. On a nomploy cluster: attribute = "$${meta.nomploy_control_plane}", operator = "=", value = "true".
resources object
{
    cpu    = 200
    memory = 64
  }
The task resources.
Readme

blackbox-exporter

Prometheus Blackbox Exporter — probes endpoints over HTTP(S), TCP, DNS, and ICMP and exposes the results for Prometheus to scrape: uptime, response time, status codes, and TLS cert expiry. Stateless host-networked Nomad service; pairs with the monitoring pack (and alert via alertmanager).

Usage

nomad-pack registry add nomploy github.com/Nomploy/nomad-packs
nomad-pack run blackbox-exporter --registry nomploy

Then have Prometheus scrape your targets through it (see the deploy output for the relabel_configs snippet). Probe directly to test:

curl "http://<node-ip>:9115/probe?target=https://example.com&module=http_2xx"

Key variables

Variable Default Notes
image prom/blackbox-exporter:latest Pin a tag in production.
port 9115 /probe + /metrics.
config http_2xx / tcp_connect / icmp Full blackbox.yml modules — extend as needed.
constraints [] Probes run from the node it lands on — pin accordingly.
resources cpu 200 / mem 64 Tiny.

Notes