How does the blackbox exporter work with Prometheus?

IntermediateConceptPrometheus Architecture
Answer

Prometheus scrapes the exporter's /probe endpoint, passing the real target as a parameter; the exporter performs the probe and returns probe_success, probe_duration_seconds, probe_ssl_earliest_cert_expiry and so on. Relabeling moves the target into the URL parameter:

- job_name: blackbox-http
  metrics_path: /probe
  params: { module: [http_2xx] }
  static_configs:
    - targets: ["https://shop.example.com"]
  relabel_configs:
    - source_labels: [__address__]
      target_label: __param_target
    - source_labels: [__param_target]
      target_label: instance
    - target_label: __address__
      replacement: blackbox-exporter:9115
All Monitoring & Observability questions Roadmap: Monitoring & alerting

More on Prometheus Architecture