From f46cf46b8cf0929ba045d766731bd1254ef52bf1 Mon Sep 17 00:00:00 2001 From: Louis Dureuil Date: Tue, 7 Feb 2023 16:01:12 +0100 Subject: [PATCH] Add prototype to analytics if any --- meilisearch/src/analytics/segment_analytics.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/meilisearch/src/analytics/segment_analytics.rs b/meilisearch/src/analytics/segment_analytics.rs index 21b6696e7..566770646 100644 --- a/meilisearch/src/analytics/segment_analytics.rs +++ b/meilisearch/src/analytics/segment_analytics.rs @@ -401,12 +401,19 @@ impl Segment { if let Ok(stats) = create_all_stats(index_scheduler.into(), auth_controller, &SearchRules::default()) { + // Replace the version number with the prototype name if any. + let version = if let Some(prototype) = crate::prototype_name() { + prototype + } else { + env!("CARGO_PKG_VERSION") + }; + let _ = self .batcher .push(Identify { context: Some(json!({ "app": { - "version": env!("CARGO_PKG_VERSION").to_string(), + "version": version.to_string(), }, })), user: self.user.clone(),