From b610f95fd3e56cee40417f59dd2e6f80132d9f5a Mon Sep 17 00:00:00 2001 From: Vidhya Venkat Date: Tue, 18 Nov 2025 14:53:07 -0800 Subject: [PATCH] Added a log message for PythonActor endpoint error Summary: As stated above. Reviewed By: shayne-fletcher Differential Revision: D87369646 --- monarch_hyperactor/src/actor.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/monarch_hyperactor/src/actor.rs b/monarch_hyperactor/src/actor.rs index dfd25603a..82c62a1bd 100644 --- a/monarch_hyperactor/src/actor.rs +++ b/monarch_hyperactor/src/actor.rs @@ -957,9 +957,12 @@ async fn handle_async_endpoint_panic( actor_id: String, endpoint: String, ) { + // Clone values before they're moved into attributes + let actor_id_str = actor_id.clone(); + let endpoint_str = endpoint.clone(); + // Create attributes for metrics with actor_id and endpoint - let attributes = - hyperactor_telemetry::kv_pairs!("actor_id" => actor_id, "endpoint" => endpoint); + let attributes = hyperactor_telemetry::kv_pairs!("actor_id" => actor_id, "method" => endpoint); // Record the start time for latency measurement let start_time = std::time::Instant::now(); @@ -1001,6 +1004,13 @@ async fn handle_async_endpoint_panic( } { // Record error and panic metrics ENDPOINT_ACTOR_ERROR.add(1, attributes); + // use hyperactor tracing to log the required metadata. + tracing::error!( + error = "ActorEndpointError", + method = %endpoint_str, + actor_id = %actor_id_str, + "caught error in async endpoint" + ); panic_sender .send(PanicFromPy(panic))