mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Merge #2429
2429: Send the analytics to `telemetry.meilisearch.com` instead of segment r=MarinPostma a=irevoire Fix #2425 Co-authored-by: Irevoire <tamo@meilisearch.com>
This commit is contained in:
commit
c7711c7816
@ -57,6 +57,7 @@ platform-dirs = "0.3.0"
|
|||||||
rand = "0.8.5"
|
rand = "0.8.5"
|
||||||
rayon = "1.5.1"
|
rayon = "1.5.1"
|
||||||
regex = "1.5.5"
|
regex = "1.5.5"
|
||||||
|
reqwest = { version = "0.11.4", features = ["rustls-tls", "json"], default-features = false }
|
||||||
rustls = "0.20.4"
|
rustls = "0.20.4"
|
||||||
rustls-pemfile = "0.3.0"
|
rustls-pemfile = "0.3.0"
|
||||||
segment = { version = "0.2.0", optional = true }
|
segment = { version = "0.2.0", optional = true }
|
||||||
|
@ -81,7 +81,19 @@ impl SegmentAnalytics {
|
|||||||
let user_id = user_id.unwrap_or_else(|| Uuid::new_v4().to_string());
|
let user_id = user_id.unwrap_or_else(|| Uuid::new_v4().to_string());
|
||||||
write_user_id(&opt.db_path, &user_id);
|
write_user_id(&opt.db_path, &user_id);
|
||||||
|
|
||||||
let client = HttpClient::default();
|
let client = reqwest::Client::builder()
|
||||||
|
.connect_timeout(Duration::from_secs(10))
|
||||||
|
.build();
|
||||||
|
|
||||||
|
// if reqwest throws an error we won't be able to send analytics
|
||||||
|
if client.is_err() {
|
||||||
|
return super::MockAnalytics::new(opt);
|
||||||
|
}
|
||||||
|
|
||||||
|
let client = HttpClient::new(
|
||||||
|
client.unwrap(),
|
||||||
|
"https://telemetry.meilisearch.com".to_string(),
|
||||||
|
);
|
||||||
let user = User::UserId { user_id };
|
let user = User::UserId { user_id };
|
||||||
let mut batcher = AutoBatcher::new(client, Batcher::new(None), SEGMENT_API_KEY.to_string());
|
let mut batcher = AutoBatcher::new(client, Batcher::new(None), SEGMENT_API_KEY.to_string());
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user