add vantage label
This commit is contained in:
parent
c847e8345b
commit
f8fd7d83b0
@ -33,7 +33,7 @@ lazy_static! {
|
||||
static ref PING_HISTOGRAM: HistogramVec = register_histogram_vec!(
|
||||
"ping_rtt_milliseconds",
|
||||
"The ping round trip time in milliseconds",
|
||||
&["target", "device", "interface", "expected", "team", "priority"],
|
||||
&["target", "device", "interface", "expected", "team", "priority", "vantage"],
|
||||
vec![
|
||||
0.125, 0.25, 0.5, 1.0, 1.5, 2.0, 2.5, 5.0, 7.5, 10.0, 15.0, 20.0, 25.0, 30.0,
|
||||
35.0, 40.0, 45.0, 50.0, 55.0, 60.0, 65.0, 70.0, 75.0, 80.0, 90.0, 100.0,
|
||||
@ -90,6 +90,7 @@ async fn handle_ping_result(result: PingFuture, host: String, hostdata: HashMap<
|
||||
let device = hostdata.get("device").unwrap_or(&empty);
|
||||
let interface = hostdata.get("interface").unwrap_or(&empty);
|
||||
let team = hostdata.get("team").unwrap_or(&empty);
|
||||
let vantage = hostdata.get("vantage").unwrap_or(&empty);
|
||||
|
||||
let up = "up".to_string();
|
||||
let expected = hostdata.get("expected").unwrap_or(&up);
|
||||
@ -102,7 +103,7 @@ async fn handle_ping_result(result: PingFuture, host: String, hostdata: HashMap<
|
||||
let ms = time.as_millis();
|
||||
trace!("Received pong from {} after {} ms", &host, &ms);
|
||||
PING_HISTOGRAM
|
||||
.with_label_values(&[&host, device, interface, expected, team, severity])
|
||||
.with_label_values(&[&host, device, interface, expected, team, severity, vantage])
|
||||
.observe(ms as f64);
|
||||
//PING_COUNTER
|
||||
// .with_label_values(&[&host])
|
||||
@ -111,8 +112,8 @@ async fn handle_ping_result(result: PingFuture, host: String, hostdata: HashMap<
|
||||
None => {
|
||||
trace!("Received no response from {} within timeout", &host);
|
||||
PING_HISTOGRAM
|
||||
.with_label_values(&[&host, device, interface, expected, team, severity])
|
||||
.observe(4000.0);
|
||||
.with_label_values(&[&host, device, interface, expected, team, severity, vantage])
|
||||
.observe(5000.0);
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user