@@ -116,7 +116,7 @@ async fn get_connect_timings(
116116 ( tls_time, cert_validity_seconds)
117117 }
118118 Err ( e) => {
119- eprintln ! ( "Failed to establish TLS connection for host {host}: {e}" ) ;
119+ log :: error !( "Failed to establish TLS connection for host {host}: {e}" ) ;
120120 return Err ( format ! (
121121 "Failed to establish TLS connection for host {host}: {e}"
122122 ) ) ;
@@ -201,7 +201,7 @@ async fn probe_url(
201201 )
202202 }
203203 Err ( e) => {
204- eprintln ! ( "HTTP request failed for URL {url}: {e}" ) ;
204+ log :: error !( "HTTP request failed for URL {url}: {e}" ) ;
205205 return Err ( format ! ( "HTTP request failed for URL {url}: {e}" ) ) ;
206206 }
207207 } ;
@@ -323,7 +323,7 @@ async fn handle_target_probe(
323323 . unwrap_or ( false ) ;
324324
325325 if accepted {
326- println ! (
326+ log :: debug !(
327327 "[{padded_tenant}] ✅ URL: {}, Status: {:?}, Elapsed: {:.2}ms, Cert: {}" ,
328328 url,
329329 probe. http_status,
@@ -334,20 +334,20 @@ async fn handle_target_probe(
334334 . unwrap_or_else( || "N/A" . to_string( ) )
335335 ) ;
336336 } else {
337- println ! (
337+ log :: error !(
338338 "[{padded_tenant}] ❌ Unexpected status for {url}: {:?} (accepted: {:?})" ,
339339 probe. http_status, target. accepted_status_codes
340340 ) ;
341341 }
342342
343343 let metrics = create_probe_metrics ( & probe, accepted) ;
344344 if let Err ( e) = send_to_mimir ( mimir_target, Some ( org_id) , metrics) . await {
345- println ! ( "[{padded_tenant}] Failed to send metrics for {url}: {e}" ) ;
345+ log :: error !( "[{padded_tenant}] Failed to send metrics for {url}: {e}" ) ;
346346 }
347347 }
348348 Err ( e) => {
349349 // in case we cannot probe the url, send a failed probe with zeroed metrics
350- println ! ( "[{padded_tenant}] ❌ Probe error for {url}: {e}" ) ;
350+ log :: error !( "[{padded_tenant}] ❌ Probe error for {url}: {e}" ) ;
351351 let probe = ProbeResult {
352352 url : url. to_string ( ) ,
353353 dns_time : None ,
@@ -362,7 +362,7 @@ async fn handle_target_probe(
362362 } ;
363363 let metrics = create_probe_metrics ( & probe, false ) ;
364364 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}" ) ;
365+ log :: error !( "[{padded_tenant}] Failed to send error metrics for {url}: {e}" ) ;
366366 }
367367 }
368368 }
0 commit comments