prometheus / blackbox_exporter

Blackbox prober exporter
https://prometheus.io
Apache License 2.0
4.44k stars 1.03k forks source link

Handle HTTP regexps from params #1247

Open flowingbits opened 1 month ago

flowingbits commented 1 month ago

This PR implements getting HTTP prober regexp matchers from the query parameters. It's a quick and dirty implementation, looking for comments.

Sample usage:

Config:

modules:
  http_2xx:
    prober: http
    http:
      preferred_ip_protocol: "ip4"
      enable_regexps_from_params: true

Request:

http://localhost:9115/probe?target=https://prometheus.io&module=http_2xx&debug=true&fail_if_body_not_matches_regexp=https://github.com/prometheus

Regexps must be URI encoded.