Blackbox exporter http module check interval - how to change default 15s

746 views
Skip to first unread message

Paweł Błażejewski

unread,
May 18, 2023, 7:52:49 AM5/18/23
to Prometheus Users

Hello,

Blackbox exporter http module check https site every 15s by default. Can you please tell me Is it posible to change this interval to 1 minute. I add scrape_interval parametr in prometheus config as you see below, but it doesn't change anything. Samples are stiil every 15s.

can you please tell me how and where change it.
I user prometheus 2.37.7, blackbox_exporter 0.23.0

prometheus config:

Samples still every 15s.

2023-05-15 09:45:00
0.0624
2023-05-15 09:45:15
0.0624
2023-05-15 09:45:30
0.0527
2023-05-15 09:45:45
0.0527
2023-05-15 09:46:00
0.0527
2023-05-15 09:46:15
0.0527
2023-05-15 09:46:30
0.0465
2023-05-15 09:46:45
0.0465
2023-05-15 09:47:00
0.0465
2023-05-15 09:47:15
0.0465
2023-05-15 09:47:30
0.0465
2023-05-15 09:47:45
0.0465

Stuart Clark

unread,
May 18, 2023, 8:47:00 AM5/18/23
to Paweł Błażejewski, Prometheus Users
On 2023-05-18 11:27, Paweł Błażejewski wrote:
> Hello,
>
> Blackbox exporter http module check https site every 15s by default.
> Can you please tell me Is it posible to change this interval to 1
> minute. I add scrape_interval parametr in prometheus config as you see
> below, but it doesn't change anything. Samples are stiil every 15s.
>
> can you please tell me how and where change it.
> I user prometheus 2.37.7, blackbox_exporter 0.23.0
>
> prometheus config:
>
> * job_name: 'blackbox-http-csci-prod'
> scrape_interval: 60s
> scrape_timeout: 50s
> metrics_path: /blackbox/probe
> params:
> module: [http_2xx]
> static_configs:
>
> * targets:
>
> * https://ci-jenkins***********/login?from=%2F
> * https://ci-jenkins-***************l/login?from=%2F
>
> * https://ci-**************/login?from=%2F
> .
> .
> .
> relabel_configs:
>
> * source_labels: [ADDRESS]
> target_label: __param_target
> * source_labels: [__param_target]
> target_label: instance * target_label: ADDRESS
>
> Samples still every 15s.
>
> 2023-05-15 09:45:00
> 0.0624
> 2023-05-15 09:45:15


How are you producing that data?

Did you remember to reload/restart Prometheus after making the change to
your config?

--
Stuart Clark

Ben Kochie

unread,
May 18, 2023, 10:33:46 AM5/18/23
to Stuart Clark, Paweł Błażejewski, Prometheus Users
Based on what little I can derive from the "data" presented. This is probably from Grafana, given that the timestamps are snapped to an even 15 seconds.

And based on this, I'm guessing this is a misunderstanding of the lookback / step interval, which will default to 15s in Grafana.

There's no actual evidence (logs) provided that the exporter is actually doing what they claim.

--
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/89897569de531dc500edf3645dc6bf1b%40Jahingo.com.

Daniel Swarbrick

unread,
May 18, 2023, 10:45:58 PM5/18/23
to Prometheus Users

Brian Candler

unread,
May 19, 2023, 3:01:47 AM5/19/23
to Prometheus Users
The way to determine for sure the scrape interval is to go to the Prometheus web interface expression editor, make sure you're in the Table view (not Graph view), and enter a range vector query like:

probe_success[5m]

This will show the raw stored data points in that time range, with their timestamps.

As Ben says, if you're looking at something from Grafana then it's making a Range query to the API, where Grafana provides a start time, an end time, and a step.  Prometheus will repeat the query at every step interval, giving the most recent value of the metric at each time (it's allowed to look back in time up to 5 minutes to find a stored data point).  Hence if Grafana asks for a 15 second step but there's a 1 minute scrape interval you'll see the same value 4 times, which matches what you see.

If you go to the Grafana data source settings page, you'll see the expected scrape interval is a setting you can adjust (and defaults to 15s)

Pawel

unread,
May 19, 2023, 5:02:30 AM5/19/23
to Prometheus Users
Thanks for all the replies, especially Brian Candler. I checked in prometheus gui and its OK. There is only 5 samples run every 1 min, so configuration in prometheus config works.
Then I change in Grafana Min Step opction to 1 min. And this is exactly what I need on dashboard.

probe_duration_seconds{instance="https://ci-**************/login?from=%2F", job="blackbox-http-csci-prod"}[5m]
0.025146308 @1684485987.797
0.024791231 @1684486047.797
0.024754819 @1684486107.797
0.040065258 @1684486167.797
0.025109773 @1684486227.797

Many thanks
Best regards Paweł
Reply all
Reply to author
Forward
0 new messages