Skip to content

Commit b91417f

Browse files
committed
Use organisationId to push metrics
1 parent a46e1ba commit b91417f

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

oxybox/src/main.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ async fn main() {
6666
let connector = tls_connector.clone();
6767
let resolver = resolver.clone();
6868
let target = target.clone();
69-
let organisation_id = key.clone();
69+
let tenant_name = key.clone();
70+
let organisation_id = org_config.organisation_id.clone();
7071
let mimir_target = mimir_target.clone();
7172

7273
let handle = tokio::spawn(async move {
@@ -82,10 +83,10 @@ async fn main() {
8283
.duration_since(UNIX_EPOCH)
8384
.expect("Cannot determine time")
8485
.as_secs_f64();
85-
let organisation_id = to_fixed_width(&organisation_id, max_org_width);
86+
let tenant_name = to_fixed_width(&tenant_name, max_org_width);
8687
if is_accepted {
8788
println!(
88-
"[{organisation_id}] ✅ URL: {}, Status: {:?}, Elapsed: {:.2}ms, Cert: {}",
89+
"[{tenant_name}] ✅ URL: {}, Status: {:?}, Elapsed: {:.2}ms, Cert: {}",
8990
url,
9091
result.http_status,
9192
result.total_probe_time * 1000.0,
@@ -96,7 +97,7 @@ async fn main() {
9697
);
9798
} else {
9899
println!(
99-
"[{organisation_id}] ❌ Unexpected status for {url}: {:?} (accepted: {:?})",
100+
"[{tenant_name}] ❌ Unexpected status for {url}: {:?} (accepted: {:?})",
100101
result.http_status, target.accepted_status_codes
101102
);
102103
}
@@ -110,12 +111,12 @@ async fn main() {
110111
.await
111112
{
112113
println!(
113-
"[{organisation_id}] Failed to send metrics for {url}: {e}"
114+
"[{tenant_name}] Failed to send metrics for {url}: {e}"
114115
);
115116
}
116117
}
117118
Err(e) => {
118-
println!("[{organisation_id}] ❌ Probe error for {url}: {e}");
119+
println!("[{tenant_name}] ❌ Probe error for {url}: {e}");
119120
}
120121
}
121122
});

0 commit comments

Comments
 (0)