Prometheus / Blackbox_exporter not allowing 401 from a target

1,305 views
Skip to first unread message

srikanth rangan

unread,
Dec 24, 2020, 2:17:54 PM12/24/20
to Prometheus Users
Hi all,
I have a case wherein I have to poll a target and its normal for the site to send me "401" code.
However, when I add the entries in prometheus.yml and a new module in blackbox_exporter.yml, prometheus does not like the 401 error and does not seem to use the blackbox_exporter at all. (I've started the blackbox on debug, on command line and its not printing anything)

/etc/prometheus/prometheus.yml :
.....
  - job_name: 'IDAHO_SERVICE_SVN_AND'
    metrics_path: /svn/idaho-config/PROD
    scrape_interval: 10s
    params:
      module: [http_401_unauth]
    static_configs:
      - targets: ['10.131.104.193']
        labels:
           group: 'IDAHO_SERVICE'
           service: 'IDAHO_SERVICE_SVN_AND'

/etc/blackbox_exporter/blackbox_exporter.yml:
...
modules:

  http_401_unauth:
    prober: http
    http:
      valid_status_codes: [401,200,409]



The error that I'm getting is :server returned HTTP status 401 Unauthorized 
It looks like Prometheus is reporting the 401 error even before asking blackbox_exporter to probe it?
Can anyone please help me understand the error ?
Thanks in advance.

Capture.PNG

Regards
Srikanth

srikanth rangan

unread,
Dec 28, 2020, 4:25:01 PM12/28/20
to Prometheus Users
I got it to work finally.




--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/9dd229c9-0171-4b64-9998-8a57cc27b92an%40googlegroups.com.

Rupendra Sen

unread,
Feb 5, 2021, 6:27:26 AM2/5/21
to Prometheus Users
Can you provide the solution?

Julius Volz

unread,
Feb 5, 2021, 7:36:22 AM2/5/21
to Rupendra Sen, Prometheus Users
Just judging from the Prometheus config above, Prometheus was scraping the 401 status code targets directly, vs. probing them through the blackbox exporter, since the necessary relabeling rules (https://github.com/prometheus/blackbox_exporter#prometheus-configuration) for that were missing.



--
Julius Volz
PromLabs - promlabs.com

Navya Krishna Dubbala

unread,
Jun 22, 2021, 12:29:28 PM6/22/21
to Prometheus Users
Hi  srikanth ,

Could you share the solution.

On Tuesday, 29 December 2020 at 02:55:01 UTC+5:30 srikanth rangan wrote:
Reply all
Reply to author
Forward
0 new messages