Blackbox exporter: Difference between revisions

From wikinotes
Line 64: Line 64:
</blockquote><!-- Rules -->
</blockquote><!-- Rules -->
</blockquote><!-- Usage -->
</blockquote><!-- Usage -->
= Debugging =
<blockquote>
The best method of testing seems to be from a web-browser (not w3m).
You can simulate a configured probe using HTTP params against blackbox's url.
<syntaxhighlight lang="yaml">
- open:  http://${IP}:9115/probe?target=https://willpittman.net&module=http_2xx&debug=true
- click: 'Logs' in a failed recent probe
- see:  request logs are at the top
- see:  at the very bottom, you're looking for 'probe_success 1'
</syntaxhighlight>
</blockquote><!-- Debugging -->

Revision as of 14:28, 20 February 2022

Prometheus exporter that probes endpoints over HTTP/HTTPS/DNS/TCP/ICMP.

Documentation

github https://github.com/prometheus/blackbox_exporter
config syntax https://github.com/prometheus/blackbox_exporter/blob/master/CONFIGURATION.md
example config https://github.com/prometheus/blackbox_exporter/blob/master/example.yml

Locations

9115 default port
http://localhost:9115 simple web-ui, with sample probe to prometheus.io
${PREFIX}/etc/blackbox_exporter.yml config

Notes

blackbox_exporter install
blackbox_exporter configuration
blackbox_exporter usage
blackbox_exporter debugging

Testing

/usr/bin/env /usr/local/bin/blackbox_exporter \
  --web.listen-address=127.0.0.1:9115 \
  --config.file=/usr/local/etc/blackbox_exporter.yml

Usage

Metrics

  • probe_success: the probe passed (no search results if no passes!)
  • up: the metric was reachable
  • promhttp_metric_handler_requests_total
up{instance="https://willpittman.net"}
absent_over_time(promhttp_metric_handler_requests_total{instance="https://willpittman.net", code="200"}[1s])