Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
MaeIsBad committed Mar 11, 2024
1 parent 74296c0 commit 9d22e79
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions examples/ping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ async fn main() -> std::io::Result<()> {
.with_env(Environment::Dev)
.with_country(Country::Common)
.with_version("1.0".to_string())
.with_telemetry(
"http://localhost:55681".to_string(),
"ping".to_string(),
)
.with_telemetry("http://localhost:55681".to_string(), "ping".to_string())
.build(),
);

Expand Down
5 changes: 1 addition & 4 deletions examples/pong.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ async fn main() -> std::io::Result<()> {
.with_env(Environment::Dev)
.with_country(Country::Common)
.with_version("1.0".to_string())
.with_telemetry(
"http://localhost:55681".to_string(),
"pong".to_string(),
)
.with_telemetry("http://localhost:55681".to_string(), "pong".to_string())
.build(),
);

Expand Down
4 changes: 2 additions & 2 deletions src/telemetry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ pub fn configure<T>(config: &SubscriberConfig<T>) -> Tracer {
// For backwards compatibility we strip it from configurations that do have it
let collector_url = collector_url
// In case of a trailing slash strip it
.strip_suffix("/")
.strip_suffix('/')
.unwrap_or(collector_url)
.strip_suffix("/v1/traces")
.unwrap_or(collector_url);

// Backport https://github.com/open-telemetry/opentelemetry-rust/pull/1553
let collector_url = collector_url.strip_suffix("/").unwrap_or(collector_url);
let collector_url = collector_url.strip_suffix('/').unwrap_or(collector_url);

let otlp_exporter = opentelemetry_otlp::new_exporter()
.http()
Expand Down

0 comments on commit 9d22e79

Please sign in to comment.