prometheus / blackbox_exporter

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

Add body_matches & status_codes as target url params #1222

Closed jeremybusk closed 6 months ago

jeremybusk commented 6 months ago

Adds two new URL passable parameters via "csv list" in target param URL for setting http config values:

Allows you to pass in a "list" of comma separated items to probe for via status_codes & valid_status_codes via status codes to set config http modules values

Example using curl:

curl -s "http://localhost:9115/probe?target=https://example.com&body_matches=example,exam&status_codes=200,401"
SuperQ commented 6 months ago

For the same reasons as #1098, we do not want these additional params.

jeremybusk commented 6 months ago

I figured this might be out of scope which is why I kept a minimal foot print. Every metric seemed overkill. It might be something to allow users to enable in the config file that enables use of these two params overrides. It would be useful for many in collecting metrics in certain situations outside of k8s ecosystem. Excellent project. Thank you for the info & speedy response!