Commit f774e70
* Fix parsing of X-Prometheus-Scrape-Timeout-Seconds header
The previous implementation expected this header to be an integer, but vmagent
may send it as a float. This caused incorrect handling in `mongodb_exporter`.
Updated to support float values.
* Avoid stale connections by pinging on acquire
The exporter was returning cached MongoDB connections without validating their health. This meant that if a connection had become unhealthy,
subsequent operations would fail after a delay (serverSelectionTimeout etc), causing the entire request to be slower than it should be.
This commit adds `Ping` check before returning a cached client.
* Update exporter/exporter.go
Co-authored-by: Alex Demidoff <[email protected]>
---------
Co-authored-by: Alex Demidoff <[email protected]>
Co-authored-by: Michael Okoko <[email protected]>
1 parent 06b081a commit f774e70
1 file changed
+18
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| |||
300 | 305 | | |
301 | 306 | | |
302 | 307 | | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
307 | 317 | | |
308 | | - | |
| 318 | + | |
309 | 319 | | |
310 | 320 | | |
311 | | - | |
| 321 | + | |
312 | 322 | | |
313 | 323 | | |
314 | 324 | | |
315 | 325 | | |
316 | | - | |
| 326 | + | |
317 | 327 | | |
318 | 328 | | |
319 | 329 | | |
| |||
0 commit comments