Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions hyperactor_mesh/src/v1/host_mesh/mesh_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!(": <error generating URL: {}>", e)))
.map_or_else(|| "".to_string(), |url| format!(": {}", url))
);
}
Ok(Self {
Expand Down
1 change: 1 addition & 0 deletions hyperactor_telemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
19 changes: 19 additions & 0 deletions hyperactor_telemetry/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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<Option<String>> {
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<Option<String>> {
Ok(None)
}

#[derive(PartialEq)]
pub enum Env {
Local,
Expand Down
Loading