fix: add OTEL_ENVIRONMENT to force otel environment

This commit is contained in:
Ruben Fiszel
2025-09-09 14:21:02 +00:00
parent c5ee42f1f9
commit 602691872a
+7 -2
View File
@@ -431,7 +431,10 @@ async fn windmill_main() -> anyhow::Result<()> {
(Connection::Sql(db), None)
};
let environment = load_base_url(&conn)
let environment = if let Ok(environment) = std::env::var("OTEL_ENVIRONMENT") {
environment
} else {
load_base_url(&conn)
.await
.unwrap_or_else(|_| "local".to_string())
.trim_start_matches("https://")
@@ -439,7 +442,9 @@ async fn windmill_main() -> anyhow::Result<()> {
.split(".")
.next()
.unwrap_or_else(|| "local")
.to_string();
.to_string()
};
let _guard = windmill_common::tracing_init::initialize_tracing(&hostname, &mode, &environment);