Skip to content

Commit

Permalink
fix: correct otlp endpoint formatting (#4646)
Browse files Browse the repository at this point in the history
  • Loading branch information
WenyXu authored Sep 2, 2024
1 parent 37dcf34 commit 2564b5d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/common/telemetry/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,13 @@ pub fn init_global_logging(
opentelemetry_otlp::new_exporter().tonic().with_endpoint(
opts.otlp_endpoint
.as_ref()
.map(|e| format!("http://{}", e))
.map(|e| {
if e.starts_with("http") {
e.to_string()
} else {
format!("http://{}", e)
}
})
.unwrap_or(DEFAULT_OTLP_ENDPOINT.to_string()),
),
)
Expand Down

0 comments on commit 2564b5d

Please sign in to comment.