added admin user email to telemetry (#128)

This commit is contained in:
Ashish Kolhe
2023-02-21 11:30:33 +05:30
committed by GitHub
parent 4c2982aa64
commit 3c3a5cdbfa
+8 -3
View File
@@ -16,7 +16,9 @@ use segment::{message::Track, Client, Message};
use serde_json::Value;
use std::collections::HashMap;
use crate::infra::config::{CONFIG, INSTANCE_ID, STREAM_SCHEMAS, TELEMETRY_CLIENT, USERS, VERSION};
use crate::infra::config::{
CONFIG, INSTANCE_ID, ROOT_USER, STREAM_SCHEMAS, TELEMETRY_CLIENT, USERS, VERSION,
};
#[derive(Clone, Debug, Default)]
pub struct Telemetry {
@@ -114,8 +116,12 @@ pub fn get_base_info(data: &mut HashMap<String, Value>) -> HashMap<String, Value
"host_name".to_string(),
CONFIG.common.instance_name.clone().into(),
);
//TODO
data.insert("zo_version".to_string(), VERSION.to_owned().into());
data.insert(
"root_user".to_string(),
serde_json::Value::String(ROOT_USER.get("root").unwrap().clone().email),
);
data.clone()
}
@@ -136,7 +142,6 @@ mod test_telemetry {
#[test]
fn test_telemetry_new() {
let tel = Telemetry::new();
//println!("{:?}", tel);
assert!(tel.base_info.len() > 0)
}
}