![]() The blackbox exporter needs to be passed the target as a parameter, this can be To read the guide Understanding and using the multi-target exporter pattern Prometheus Configurationīlackbox exporter implements the multi-target exporter pattern, so we advice If neither is specified, it defaults to 120 seconds. This can be further limited by the timeout in the Blackbox exporter config file. The timeout of each probe is automatically determined from the scrape_timeout in the Prometheus config, slightly reduced to allow for network delays. HTTP, HTTPS (via the http prober), DNS, TCP socket, ICMP and gRPC (see permissions section) are currently supported.Īdditional modules can be defined to meet your needs. To specify which configuration file to load, use the -config.file flag.Īdditionally, an example configuration is also available. To view all available command-line flags, run. If the new configuration is not well-formed, the changes will not be applied.Ī configuration reload is triggered by sending a SIGHUP to the Blackbox exporter process or by sending a HTTP POST request to the /-/reload endpoint. īlackbox exporter is configured via a configuration file and command-line flags (such as what configuration file to load, what port to listen on, and the logging format and level).īlackbox exporter can reload its configuration file at runtime. Building the software Local Build makeĪfter a successful local build: docker build -t blackbox_exporter. metrics for scraping, /probe for probing, and the web UI. Note that the TLS and basic authentication settings affect all HTTP endpoints: To use TLS and/or basic authentication, you need to pass a configuration file The Blackbox Exporter supports TLS and basic authentication. Will return debug information for that probe. Visiting will return metrics for a HTTP probe against. ![]() Quay.io/prometheus/blackbox-exporter:latest -config.file=/config/blackbox.yml Note: You may want to enable ipv6 in your docker configuration docker run -rm \ Running this software From binariesĭownload the most suitable binary from the releases tab Let’s run a prometheus container with the above config and see all of this in action.The blackbox exporter allows blackbox probing of endpoints over The prometheus.yaml configuration file which points to the blackbox exporter we have running from Step 1. Now that our blackbox exporter config is ready, let’s add the necessary config on Prometheus. If you were to switch or change the regex pattern so that the response body would not match it, probe_failed_due_to_regex 1 will be returned instead. This means our config worked, the probe hit with the data as defined in the post_one_2xx module AND matched the regex as defined under the module property fail_if_body_not_matches_regexp. Look for the probe_failed_due_to_regex 0 and probe_http_status_code 200 metric outputs. ![]() Let’s run a blackbox exporter container with the above config and see if this works.ĭocker run -rm -d -p 9115:9115 -name blackbox_exporter -v `pwd `:/config prom/blackbox-exporter:master -config.file =/config/blackbox.yamlīlackbox exporter should now be available on The endpoint of interest to us is Hit the probe endpoint either through curl or on the browser - You should get a page with quite a few metrics listed. Notice we also use the property fail_if_body_not_matches_regexp, which will fail our test if the response doesn’t have the text we expect. The blackbox.yaml configuration file with 2 new modules for each post request. Add a new job in prometheus config to use the module created under 1. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |