diff --git a/.pipelines/templates/stages/testing_common/scripts/upload_metrics.sh b/.pipelines/templates/stages/testing_common/scripts/upload_metrics.sh index ec4c5d4d8..31ab4b1b3 100644 --- a/.pipelines/templates/stages/testing_common/scripts/upload_metrics.sh +++ b/.pipelines/templates/stages/testing_common/scripts/upload_metrics.sh @@ -23,6 +23,7 @@ python bmp-kusto-scripts/kusto_ingestor.py \ --database "$KUSTO_DATABASE_NAME" \ --table "$KUSTO_TABLE_NAME" \ --filepath "$METRICS_FILE" \ - --mapping "$KUSTO_TABLE_MAPPING" + --mapping "$KUSTO_TABLE_MAPPING" \ + --ignore-schema echo "Metrics uploaded successfully to Kusto." diff --git a/crates/trident/src/logging/tracestream.rs b/crates/trident/src/logging/tracestream.rs index 2ee032c73..576b07949 100644 --- a/crates/trident/src/logging/tracestream.rs +++ b/crates/trident/src/logging/tracestream.rs @@ -30,8 +30,6 @@ use crate::{ datastore::DataStore, logging::operation_context, TRIDENT_METRICS_FILE_PATH, TRIDENT_VERSION, }; -/// The product uuid is used to identify the hardware that Trident is running on. -const PRODUCT_UUID_FILE: &str = "/sys/class/dmi/id/product_uuid"; lazy_static::lazy_static! { static ref ADDITIONAL_FIELDS: BTreeMap = populate_additional_fields(); pub static ref PLATFORM_INFO: BTreeMap = populate_platform_info(); @@ -660,17 +658,6 @@ pub(crate) fn merge_operation_context(fields: &mut BTreeMap) { } } -/// Obtain product uuid of the hardware Trident is running on -fn read_product_uuid(filepath: String) -> String { - match fs::read_to_string(filepath.clone()) { - Ok(uuid) => uuid.trim().to_string(), - Err(_) => { - debug!("Failed to read product uuid from {}", filepath); - "unknown".into() - } - } -} - fn populate_additional_fields() -> BTreeMap { // TODO: Add more additional fields here as needed let mut additional_fields = BTreeMap::new(); @@ -702,10 +689,6 @@ fn populate_platform_info() -> BTreeMap { let mut platform_info = BTreeMap::new(); let mut sys = System::new(); sys.refresh_all(); - platform_info.insert( - "asset_id".to_string(), - json!(read_product_uuid(PRODUCT_UUID_FILE.into())), - ); platform_info.insert("os_release".to_string(), json!(get_os_release())); platform_info.insert("total_cpu".to_string(), json!(sys.cpus().len())); platform_info.insert( @@ -730,7 +713,7 @@ mod tests { use std::{ fs::File, - io::{BufRead, BufReader, Write}, + io::{BufRead, BufReader}, }; use tracing_subscriber::{filter, layer::SubscriberExt}; @@ -822,22 +805,6 @@ mod tests { ); } - #[test] - fn test_read_product_uuid_unknown() { - let uuid = read_product_uuid("unknown".to_string()); - assert_eq!(uuid, "unknown"); - } - - #[test] - fn test_read_product_uuid_exists() { - let temp_dir = tempfile::tempdir().unwrap(); - let filepath = temp_dir.path().join("product_uuid"); - let mut file = File::create(&filepath).unwrap(); - file.write_all("test_uuid".as_bytes()).unwrap(); - let uuid = read_product_uuid(filepath.to_str().unwrap().to_string()); - assert_eq!(uuid, "test_uuid"); - } - #[test] fn test_tracestream_write_metric_event_to_file() { let temp_dir = tempfile::tempdir().unwrap(); @@ -1009,9 +976,9 @@ mod functional_test { // These two remain functional tests (VM-only) because they assert // against the actual host's hardware/platform info (CPU count, memory, - // product UUID, os-release, kernel version) -- unlike the metrics-file - // tests above, there's no way to inject a fake value here, so the - // result is inherently host-dependent. + // os-release, kernel version) -- unlike the metrics-file tests above, + // there's no way to inject a fake value here, so the result is + // inherently host-dependent. #[functional_test] fn test_populate_additional_fields() { @@ -1025,10 +992,6 @@ mod functional_test { #[functional_test] fn test_populate_platform_info() { let mut expected_platform_info = BTreeMap::new(); - expected_platform_info.insert( - "asset_id".to_string(), - json!(read_product_uuid(PRODUCT_UUID_FILE.into())), - ); expected_platform_info.insert("os_release".to_string(), json!(get_os_release())); expected_platform_info.insert("total_cpu".to_string(), json!(4)); expected_platform_info.insert("total_memory_gib".to_string(), json!(6)); diff --git a/docs/Reference/Telemetry.md b/docs/Reference/Telemetry.md index 1b4dbbacb..48e71d8d6 100644 --- a/docs/Reference/Telemetry.md +++ b/docs/Reference/Telemetry.md @@ -24,7 +24,6 @@ Every event sent also includes as much of the following host metadata as is available at the time, so operators should be aware this leaves the host along with the metrics/spans themselves: -- `asset_id`: the host's DMI product UUID (a stable hardware identifier). - `os_release`: the `VERSION` field from `/etc/os-release`. - `kernel_version`: the running kernel release (`uname -r`). - `total_cpu`: the number of CPUs.