BlackBox Exporter
The Blackbox Exporter is a probing tool used to monitor the availability of external endpoints, such as websites or services. It works by sending requests to endpoints and collecting data on their availability, response time, and status codes, which are then scraped by Prometheus. The data collected by the Blackbox Exporter can be visualized in Grafana using panels to show uptime, response times, and more.
Scrape Setup
To scrape your endpoint, you need to create an entry in this section of the prometheus.yml
configuration:
extraScrapeConfigs: |
- job_name: 'blackbox'
metrics_path: /probe
scrape_interval: 15s
params:
module: [http_2xx] # Look for an HTTP 200 response.
static_configs:
- targets:
- https://your-endpoint.com
- https://another-endpoint.com
- job_name: The name of the scrape job (blackbox in this example) used to identify the probe.
- metrics_path: Specifies the path for scraping metrics. The Blackbox Exporter's metrics are available at /probe.
- scrape_interval: Defines how often Prometheus will probe the endpoints. Here, it probes every 15 seconds.
- params: Parameters passed to the probe. For instance, module: [http_2xx] ensures the probe checks for a successful HTTP 200 response.
- static_configs: Lists the endpoints to probe.
To add, update, or remove an endpoint to scrape, or to modify an entire scrape job, you need to create a pull request
here.
After that, please notify the infra team for a review and upgrade.
Alerting
After setting up scraping with the Blackbox Exporter, you may want to configure alerts to monitor the health
and performance of the scraped endpoints.
For more details about setting up alerts with Prometheus, see the Prometheus Alerts section.