@@ -50,6 +50,123 @@ using the `--web.config.file` parameter. The format of the file is described
50
50
Note that the TLS and basic authentication settings affect all HTTP endpoints:
51
51
/metrics for scraping, /probe for probing, and the web UI.
52
52
53
+ ### Controlling log level for probe logs
54
+
55
+ It is possible to control the level at which probe logs related to a scrape are output as.
56
+
57
+ Probe logs default to ` debug ` level, and can be controlled by the ` --log.prober ` flag.
58
+ This means that probe scrape logs will not be output unless the level configured for the probe logger via ` --log.prober ` is >= the level configured for the blackbox_exporter via ` --log.level ` .
59
+
60
+ Sample output demonstrating the use and effect of these flags can be seen below.
61
+
62
+ > _ Note_
63
+ >
64
+ > All log samples below used the following basic ` blackbox.yml ` configuration file and contain the probe logs of a single scrape generated by ` curl `
65
+
66
+ ``` bash
67
+ # blackbox.yml
68
+ modules:
69
+ http_2xx:
70
+ prober: http
71
+
72
+ # generate probe
73
+ curl " http://localhost:9115/probe?target=prometheus.io&module=http_2xx"
74
+ ```
75
+
76
+ <details >
77
+ <summary >Example output with `--log.level=info` and `--log.prober=debug` (default)</summary >
78
+
79
+ ``` bash
80
+ ./blackbox_exporter --config.file ./blackbox.yml --log.level=info --log.prober=debug
81
+ time=2025-05-21T04:10:54.131Z level=INFO source=main.go:88 msg=" Starting blackbox_exporter" version=" (version=0.26.0, branch=fix/scrape-logger-spam, revision=7df3031feecba82f1a534336979b4e5920f79b72)"
82
+ time=2025-05-21T04:10:54.131Z level=INFO source=main.go:89 msg=" (go=go1.24.1, platform=linux/amd64, user=tjhop@contraband, date=20250521-04:00:25, tags=unknown)"
83
+ time=2025-05-21T04:10:54.132Z level=INFO source=main.go:101 msg=" Loaded config file"
84
+ time=2025-05-21T04:10:54.133Z level=INFO source=tls_config.go:347 msg=" Listening on" address=[::]:9115
85
+ time=2025-05-21T04:10:54.133Z level=INFO source=tls_config.go:350 msg=" TLS is disabled." http2=false address=[::]:9115
86
+ ^Ctime=2025-05-21T04:11:03.619Z level=INFO source=main.go:283 msg=" Received SIGTERM, exiting gracefully..."
87
+ ```
88
+ </details >
89
+
90
+ <details >
91
+ <summary >Example output with `--log.level=info` and `--log.prober=info`</summary >
92
+
93
+ ``` bash
94
+ ./blackbox_exporter --config.file ./blackbox.yml --log.level=info --log.prober=info
95
+ time=2025-05-21T04:12:09.884Z level=INFO source=main.go:88 msg=" Starting blackbox_exporter" version=" (version=0.26.0, branch=fix/scrape-logger-spam, revision=7df3031feecba82f1a534336979b4e5920f79b72)"
96
+ time=2025-05-21T04:12:09.884Z level=INFO source=main.go:89 msg=" (go=go1.24.1, platform=linux/amd64, user=tjhop@contraband, date=20250521-04:00:25, tags=unknown)"
97
+ time=2025-05-21T04:12:09.884Z level=INFO source=main.go:101 msg=" Loaded config file"
98
+ time=2025-05-21T04:12:09.885Z level=INFO source=tls_config.go:347 msg=" Listening on" address=[::]:9115
99
+ time=2025-05-21T04:12:09.885Z level=INFO source=tls_config.go:350 msg=" TLS is disabled." http2=false address=[::]:9115
100
+ time=2025-05-21T04:12:13.827Z level=INFO source=handler.go:194 msg=" Beginning probe" module=http_2xx target=prometheus.io probe=http timeout_seconds=119.5
101
+ time=2025-05-21T04:12:13.827Z level=INFO source=handler.go:194 msg=" Resolving target address" module=http_2xx target=prometheus.io target=prometheus.io ip_protocol=ip4
102
+ time=2025-05-21T04:12:13.829Z level=INFO source=handler.go:194 msg=" Resolved target address" module=http_2xx target=prometheus.io target=prometheus.io ip=172.67.201.240
103
+ time=2025-05-21T04:12:13.829Z level=INFO source=handler.go:194 msg=" Making HTTP request" module=http_2xx target=prometheus.io url=http://172.67.201.240 host=prometheus.io
104
+ time=2025-05-21T04:12:13.860Z level=INFO source=handler.go:194 msg=" Received redirect" module=http_2xx target=prometheus.io location=https://prometheus.io/
105
+ time=2025-05-21T04:12:13.860Z level=INFO source=handler.go:194 msg=" Making HTTP request" module=http_2xx target=prometheus.io url=https://prometheus.io/ host=" "
106
+ time=2025-05-21T04:12:13.860Z level=INFO source=handler.go:194 msg=" Address does not match first address, not sending TLS ServerName" module=http_2xx target=prometheus.io first=172.67.201.240 address=prometheus.io
107
+ time=2025-05-21T04:12:13.974Z level=INFO source=handler.go:194 msg=" Received HTTP response" module=http_2xx target=prometheus.io status_code=200
108
+ time=2025-05-21T04:12:13.974Z level=INFO source=handler.go:194 msg=" Response timings for roundtrip" module=http_2xx target=prometheus.io roundtrip=0 start=2025-05-21T00:12:13.829-04:00 dnsDone=2025-05-21T00:12:13.829-04:00 connectDone=2025-05-21T00:12:13.839-04:00 gotConn=2025-05-21T00:12:13.839-04:00 responseStart=2025-05-21T00:12:13.860-04:00 tlsStart=0001-01-01T00:00:00.000Z tlsDone=0001-01-01T00:00:00.000Z end=0001-01-01T00:00:00.000Z
109
+ time=2025-05-21T04:12:13.974Z level=INFO source=handler.go:194 msg=" Response timings for roundtrip" module=http_2xx target=prometheus.io roundtrip=1 start=2025-05-21T00:12:13.860-04:00 dnsDone=2025-05-21T00:12:13.861-04:00 connectDone=2025-05-21T00:12:13.869-04:00 gotConn=2025-05-21T00:12:13.925-04:00 responseStart=2025-05-21T00:12:13.974-04:00 tlsStart=2025-05-21T00:12:13.869-04:00 tlsDone=2025-05-21T00:12:13.925-04:00 end=2025-05-21T00:12:13.974-04:00
110
+ time=2025-05-21T04:12:13.974Z level=INFO source=handler.go:194 msg=" Probe succeeded" module=http_2xx target=prometheus.io duration_seconds=0.14708839
111
+ ^Ctime=2025-05-21T04:12:17.818Z level=INFO source=main.go:283 msg=" Received SIGTERM, exiting gracefully..."
112
+ ```
113
+ </details >
114
+
115
+ <details >
116
+ <summary >Example output with `--log.level=debug` and `--log.prober=info`</summary >
117
+
118
+ ``` bash
119
+ ./blackbox_exporter --config.file ./blackbox.yml --log.level=debug --log.prober=info
120
+ time=2025-05-21T04:13:18.497Z level=INFO source=main.go:88 msg=" Starting blackbox_exporter" version=" (version=0.26.0, branch=fix/scrape-logger-spam, revision=7df3031feecba82f1a534336979b4e5920f79b72)"
121
+ time=2025-05-21T04:13:18.497Z level=INFO source=main.go:89 msg=" (go=go1.24.1, platform=linux/amd64, user=tjhop@contraband, date=20250521-04:00:25, tags=unknown)"
122
+ time=2025-05-21T04:13:18.497Z level=INFO source=main.go:101 msg=" Loaded config file"
123
+ time=2025-05-21T04:13:18.498Z level=DEBUG source=main.go:116 msg=http://contraband:9115
124
+ time=2025-05-21T04:13:18.498Z level=DEBUG source=main.go:130 msg=/
125
+ time=2025-05-21T04:13:18.498Z level=INFO source=tls_config.go:347 msg=" Listening on" address=[::]:9115
126
+ time=2025-05-21T04:13:18.498Z level=INFO source=tls_config.go:350 msg=" TLS is disabled." http2=false address=[::]:9115
127
+ time=2025-05-21T04:13:23.169Z level=INFO source=handler.go:194 msg=" Beginning probe" module=http_2xx target=prometheus.io probe=http timeout_seconds=119.5
128
+ time=2025-05-21T04:13:23.169Z level=INFO source=handler.go:194 msg=" Resolving target address" module=http_2xx target=prometheus.io target=prometheus.io ip_protocol=ip4
129
+ time=2025-05-21T04:13:23.170Z level=INFO source=handler.go:194 msg=" Resolved target address" module=http_2xx target=prometheus.io target=prometheus.io ip=104.21.60.220
130
+ time=2025-05-21T04:13:23.170Z level=INFO source=handler.go:194 msg=" Making HTTP request" module=http_2xx target=prometheus.io url=http://104.21.60.220 host=prometheus.io
131
+ time=2025-05-21T04:13:23.202Z level=INFO source=handler.go:194 msg=" Received redirect" module=http_2xx target=prometheus.io location=https://prometheus.io/
132
+ time=2025-05-21T04:13:23.202Z level=INFO source=handler.go:194 msg=" Making HTTP request" module=http_2xx target=prometheus.io url=https://prometheus.io/ host=" "
133
+ time=2025-05-21T04:13:23.202Z level=INFO source=handler.go:194 msg=" Address does not match first address, not sending TLS ServerName" module=http_2xx target=prometheus.io first=104.21.60.220 address=prometheus.io
134
+ time=2025-05-21T04:13:23.316Z level=INFO source=handler.go:194 msg=" Received HTTP response" module=http_2xx target=prometheus.io status_code=200
135
+ time=2025-05-21T04:13:23.319Z level=INFO source=handler.go:194 msg=" Response timings for roundtrip" module=http_2xx target=prometheus.io roundtrip=0 start=2025-05-21T00:13:23.171-04:00 dnsDone=2025-05-21T00:13:23.171-04:00 connectDone=2025-05-21T00:13:23.181-04:00 gotConn=2025-05-21T00:13:23.181-04:00 responseStart=2025-05-21T00:13:23.201-04:00 tlsStart=0001-01-01T00:00:00.000Z tlsDone=0001-01-01T00:00:00.000Z end=0001-01-01T00:00:00.000Z
136
+ time=2025-05-21T04:13:23.319Z level=INFO source=handler.go:194 msg=" Response timings for roundtrip" module=http_2xx target=prometheus.io roundtrip=1 start=2025-05-21T00:13:23.202-04:00 dnsDone=2025-05-21T00:13:23.203-04:00 connectDone=2025-05-21T00:13:23.212-04:00 gotConn=2025-05-21T00:13:23.268-04:00 responseStart=2025-05-21T00:13:23.316-04:00 tlsStart=2025-05-21T00:13:23.212-04:00 tlsDone=2025-05-21T00:13:23.268-04:00 end=2025-05-21T00:13:23.319-04:00
137
+ time=2025-05-21T04:13:23.319Z level=INFO source=handler.go:194 msg=" Probe succeeded" module=http_2xx target=prometheus.io duration_seconds=0.150580389
138
+ ^Ctime=2025-05-21T04:13:27.945Z level=INFO source=main.go:283 msg=" Received SIGTERM, exiting gracefully..."
139
+ ```
140
+ </details >
141
+
142
+
143
+ <details >
144
+ <summary >Example output with `--log.level=debug` and `--log.prober=debug`</summary >
145
+
146
+ ``` bash
147
+ ./blackbox_exporter --config.file ./blackbox.yml --log.level=debug --log.prober=debug
148
+ time=2025-05-21T04:14:55.621Z level=INFO source=main.go:88 msg=" Starting blackbox_exporter" version=" (version=0.26.0, branch=fix/scrape-logger-spam, revision=7df3031feecba82f1a534336979b4e5920f79b72)"
149
+ time=2025-05-21T04:14:55.621Z level=INFO source=main.go:89 msg=" (go=go1.24.1, platform=linux/amd64, user=tjhop@contraband, date=20250521-04:00:25, tags=unknown)"
150
+ time=2025-05-21T04:14:55.622Z level=INFO source=main.go:101 msg=" Loaded config file"
151
+ time=2025-05-21T04:14:55.622Z level=DEBUG source=main.go:116 msg=http://contraband:9115
152
+ time=2025-05-21T04:14:55.622Z level=DEBUG source=main.go:130 msg=/
153
+ time=2025-05-21T04:14:55.623Z level=INFO source=tls_config.go:347 msg=" Listening on" address=[::]:9115
154
+ time=2025-05-21T04:14:55.623Z level=INFO source=tls_config.go:350 msg=" TLS is disabled." http2=false address=[::]:9115
155
+ time=2025-05-21T04:15:03.048Z level=DEBUG source=handler.go:194 msg=" Beginning probe" module=http_2xx target=prometheus.io probe=http timeout_seconds=119.5
156
+ time=2025-05-21T04:15:03.049Z level=DEBUG source=handler.go:194 msg=" Resolving target address" module=http_2xx target=prometheus.io target=prometheus.io ip_protocol=ip4
157
+ time=2025-05-21T04:15:03.050Z level=DEBUG source=handler.go:194 msg=" Resolved target address" module=http_2xx target=prometheus.io target=prometheus.io ip=172.67.201.240
158
+ time=2025-05-21T04:15:03.050Z level=DEBUG source=handler.go:194 msg=" Making HTTP request" module=http_2xx target=prometheus.io url=http://172.67.201.240 host=prometheus.io
159
+ time=2025-05-21T04:15:03.089Z level=DEBUG source=handler.go:194 msg=" Received redirect" module=http_2xx target=prometheus.io location=https://prometheus.io/
160
+ time=2025-05-21T04:15:03.089Z level=DEBUG source=handler.go:194 msg=" Making HTTP request" module=http_2xx target=prometheus.io url=https://prometheus.io/ host=" "
161
+ time=2025-05-21T04:15:03.089Z level=DEBUG source=handler.go:194 msg=" Address does not match first address, not sending TLS ServerName" module=http_2xx target=prometheus.io first=172.67.201.240 address=prometheus.io
162
+ time=2025-05-21T04:15:03.211Z level=DEBUG source=handler.go:194 msg=" Received HTTP response" module=http_2xx target=prometheus.io status_code=200
163
+ time=2025-05-21T04:15:03.212Z level=DEBUG source=handler.go:194 msg=" Response timings for roundtrip" module=http_2xx target=prometheus.io roundtrip=0 start=2025-05-21T00:15:03.050-04:00 dnsDone=2025-05-21T00:15:03.050-04:00 connectDone=2025-05-21T00:15:03.061-04:00 gotConn=2025-05-21T00:15:03.061-04:00 responseStart=2025-05-21T00:15:03.089-04:00 tlsStart=0001-01-01T00:00:00.000Z tlsDone=0001-01-01T00:00:00.000Z end=0001-01-01T00:00:00.000Z
164
+ time=2025-05-21T04:15:03.212Z level=DEBUG source=handler.go:194 msg=" Response timings for roundtrip" module=http_2xx target=prometheus.io roundtrip=1 start=2025-05-21T00:15:03.089-04:00 dnsDone=2025-05-21T00:15:03.090-04:00 connectDone=2025-05-21T00:15:03.102-04:00 gotConn=2025-05-21T00:15:03.163-04:00 responseStart=2025-05-21T00:15:03.211-04:00 tlsStart=2025-05-21T00:15:03.102-04:00 tlsDone=2025-05-21T00:15:03.163-04:00 end=2025-05-21T00:15:03.212-04:00
165
+ time=2025-05-21T04:15:03.212Z level=DEBUG source=handler.go:194 msg=" Probe succeeded" module=http_2xx target=prometheus.io duration_seconds=0.163695815
166
+ ^Ctime=2025-05-21T04:15:07.862Z level=INFO source=main.go:283 msg=" Received SIGTERM, exiting gracefully..."
167
+ ```
168
+ </details >
169
+
53
170
## Building the software
54
171
55
172
### Local Build
0 commit comments