From 8fa7b725ac1116d07c6054a16a232277cf936c15 Mon Sep 17 00:00:00 2001 From: Brian Fjeldstad Date: Mon, 7 Sep 2026 21:13:37 +0000 Subject: [PATCH] telemetry: remove asset_id from platform info Also passes --ignore-schema to the Kusto ingestor in .pipelines/templates/stages/testing_common/scripts/upload_metrics.sh, since this PR changes the local metrics schema (installation_id rename, servicing_id addition, asset_id removal) and the pipeline must not fail ingestion on the resulting schema drift. --- .../testing_common/scripts/upload_metrics.sh | 3 +- crates/trident/src/logging/tracestream.rs | 39 +------------------ docs/Reference/Telemetry.md | 1 - 3 files changed, 3 insertions(+), 40 deletions(-) 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 2c9284486..9decbd9f2 100644 --- a/crates/trident/src/logging/tracestream.rs +++ b/crates/trident/src/logging/tracestream.rs @@ -31,8 +31,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(); @@ -557,17 +555,6 @@ 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(); @@ -599,10 +586,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( @@ -627,7 +610,7 @@ mod tests { use std::{ fs::File, - io::{BufRead, BufReader, Write}, + io::{BufRead, BufReader}, }; use tracing_subscriber::{filter, layer::SubscriberExt}; @@ -719,22 +702,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(); @@ -883,10 +850,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 bf2c79a15..41375e41f 100644 --- a/docs/Reference/Telemetry.md +++ b/docs/Reference/Telemetry.md @@ -24,7 +24,6 @@ Every event sent also includes the following host metadata, 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.