Skip to content

Commit

Permalink
fix: default url for telemetry should include protocol
Browse files Browse the repository at this point in the history
closes: #25502
  • Loading branch information
praveen-influx committed Nov 4, 2024
1 parent aa70a73 commit 7939a56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion influxdb3/src/commands/serve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ pub struct Config {
#[clap(
long = "telemetry-endpoint",
env = "INFLUXDB3_TELEMETRY_ENDPOINT",
default_value = "localhost",
default_value = "http://127.0.0.1:9999",
action
)]
pub telemetry_endpoint: String,
Expand Down
13 changes: 13 additions & 0 deletions influxdb3_telemetry/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ mod tests {
mock.assert_async().await;
}

#[test_log::test(test)]
#[should_panic]
fn test_sender_creation_with_invalid_url_panics() {
let client = reqwest::Client::new();
let _ = TelemetrySender::new(client, "localhost");
}

#[test_log::test(test)]
fn test_sender_creation_with_valid_url_succeeds() {
let client = reqwest::Client::new();
let _ = TelemetrySender::new(client, "http://localhost");
}

#[test]
fn test_url_join() {
let url = Url::parse("https://foo.com/boo/1.html").unwrap();
Expand Down

0 comments on commit 7939a56

Please sign in to comment.