diff --git a/hyperactor_mesh/src/v1/host_mesh/mesh_agent.rs b/hyperactor_mesh/src/v1/host_mesh/mesh_agent.rs index 9d89d64e0..a2c09ae96 100644 --- a/hyperactor_mesh/src/v1/host_mesh/mesh_agent.rs +++ b/hyperactor_mesh/src/v1/host_mesh/mesh_agent.rs @@ -132,8 +132,14 @@ impl Actor for HostMeshAgent { ) .unwrap(); eprintln!( - "Monarch internal logs are being written to {}/{}.log", - directory, file + "Monarch internal logs are being written to {}/{}.log; execution id {}{}", + directory, + file, + hyperactor_telemetry::env::execution_id(), + hyperactor_telemetry::env::execution_url() + .await + .unwrap_or_else(|e| Some(format!(": ", e))) + .map_or_else(|| "".to_string(), |url| format!(": {}", url)) ); } Ok(Self { diff --git a/hyperactor_telemetry/Cargo.toml b/hyperactor_telemetry/Cargo.toml index d01e23b0f..35c4a6fb4 100644 --- a/hyperactor_telemetry/Cargo.toml +++ b/hyperactor_telemetry/Cargo.toml @@ -32,6 +32,7 @@ tracing-appender = "0.2.3" tracing-core = { version = "0.1.33", features = ["valuable"] } tracing-glog = { version = "0.4.1", features = ["ansi", "tracing-log"] } tracing-subscriber = { version = "0.3.20", features = ["chrono", "env-filter", "json", "local-time", "parking_lot", "registry"] } +urlencoding = "2.1.0" whoami = "1.5" [dev-dependencies] diff --git a/hyperactor_telemetry/src/lib.rs b/hyperactor_telemetry/src/lib.rs index a3cb80a35..aa11be1f5 100644 --- a/hyperactor_telemetry/src/lib.rs +++ b/hyperactor_telemetry/src/lib.rs @@ -12,6 +12,7 @@ #![feature(mpmc_channel)] #![feature(cfg_version)] #![feature(formatting_options)] +#![recursion_limit = "256"] // TODO:ehedeman Remove or replace with better config once telemetry perf issues are solved /// Environment variable to disable the OpenTelemetry logging layer. @@ -721,6 +722,24 @@ pub mod env { id } + /// Returns a URL for the execution trace, if available. + #[cfg(fbcode_build)] + pub async fn execution_url() -> anyhow::Result> { + let fb = if fbinit::was_performed() { + fbinit::expect_init() + } else { + // Safety: This is going to be embedded in a python library, so we can't be sure when fbinit has been called. + unsafe { fbinit::perform_init() } + }; + Ok(Some( + crate::meta::scuba_tracing::url::get_samples_shorturl(fb, &execution_id()).await?, + )) + } + #[cfg(not(fbcode_build))] + pub async fn execution_url() -> anyhow::Result> { + Ok(None) + } + #[derive(PartialEq)] pub enum Env { Local,