Skip to content

Commit 9b40f23

Browse files
author
Thomas Luijken
committed
Also send failed probe attempts to Mimir
1 parent 7fd07f6 commit 9b40f23

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

oxybox/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "oxybox"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
authors = ["Thomas Luijken"]
55
categories = ["command-line-utilities"]
66
description = "A drop in replacement for blackbox exporter for Prometheus, with support for TLS and HTTP/3."

oxybox/src/http_probe/probe.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,24 @@ async fn handle_target_probe(
346346
}
347347
}
348348
Err(e) => {
349+
// in case we cannot probe the url, send a failed probe with zeroed metrics
349350
println!("[{padded_tenant}] ❌ Probe error for {url}: {e}");
351+
let probe = ProbeResult {
352+
url: url.to_string(),
353+
dns_time: None,
354+
connect_time: None,
355+
tls_time: None,
356+
processing_time: None,
357+
cert_validity_seconds: None,
358+
http_status: None,
359+
http_version: None,
360+
transfer_time: None,
361+
total_probe_time: 0.0,
362+
};
363+
let metrics = create_probe_metrics(&probe, false);
364+
if let Err(e) = send_to_mimir(mimir_target, Some(org_id), metrics).await {
365+
println!("[{padded_tenant}] Failed to send error metrics for {url}: {e}");
366+
}
350367
}
351368
}
352369
}

0 commit comments

Comments
 (0)