
config:įirst module is for checking the normal endpoint whether they are reachable or not.ĪND second module is for checking the api with a bearer token. Sudo systemctl restart sure whether you have still the same issue but i have tried to setup the api checks (whether api is working fine or not) via blackbox exporter and while installing the exporter i have used below config. Restart the services prometheus and blackbox sudo systemctl restart rvice Replacement: localhost:9115 # The blackbox exporter's real hostname:port.
Prometheus blackbox exporter example password#
# It is authenticated by username and password Valid_http_versions: Įdit the prometheus.yml - job_name: 'blackbox'
Prometheus blackbox exporter example how to#
How to monitor authenticated API endpoint that requires username and password Thanks in advance and really appreciate any help! (Should I set the basic_auth username and password according to (1)? Where the token is returned? And should I replace the token to bearer_token?)Īny guidance on this would be great! I am pretty new to the whole process, sorry if the question is too fundamental or ambiguous. I've seen config of blackbox-exporter of basic_auth and bearer_token, but not sure how to actually setup the params and how to redirect to other pages. (4)After authentication, it should still send the http request at some frequency and output the metrics just as the blackbox-exporter do.īasically I am trying to mimic the same procedure for sequence of API calls in Postman tests. All the other endpoints should only be pinged, if the access_token is already there and correct. (3) preserve this access_token and direct to other pages. (1) send http POST with of Bearer token type Not sure my problem could be solved by built-in prometheus configs, let me describe the flow I would like to achieve: OS X: No additional privileges are needed.I am pretty new to the Prometheus and not sure how I am going to ping the endpoint with authentication.Alternatively the capability can be set by executing setcap cap_net_raw+ep blackbox_exporter._group_range = 0 2147483647 to allow any user the ability Your distribution may configure _group_range by default in.Linux: either a user with a group within _group_range, theĬAP_NET_RAW capability or the root user is required.Windows: Administrator privileges are required.The ICMP probe requires elevated privileges to function: source_labels: target_label: vhost # and store it in 'vhost' label Permissions source_labels: target_label: _param_hostname # Make domain name become 'Host' header for probe requests target_label: _address_ replacement: 127.0.0.1:9115 # The blackbox exporter's real hostname:port. source_labels: target_label: _param_target replacement: # Make probe URL be like

prometheus.io type: A port: 443 relabel_configs: job_name: blackbox_all metrics_path: /probe params:

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. Blackbox 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.
