fix: default url for telemetry should include protocol
closes: https://github.com/influxdata/influxdb/issues/25502praveen/fix-telemetry-url-panic
parent
aa70a73487
commit
7939a56c5f
|
@ -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,
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue