From bd86ce791a62127ab812cca725d00b50c87f5ccc Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Wed, 21 Aug 2024 10:51:36 -0700 Subject: [PATCH] add component descriptions to target --- gateway/src/metrics.rs | 10 ++++++---- oximeter/oximeter/schema/sensor-measurement.toml | 12 ++++++++++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/gateway/src/metrics.rs b/gateway/src/metrics.rs index 355ccd96ce2..c631532fba0 100644 --- a/gateway/src/metrics.rs +++ b/gateway/src/metrics.rs @@ -686,7 +686,7 @@ impl SpPoller { { continue; } - let component = match dev.component.as_str() { + let component_id = match dev.component.as_str() { Some(c) => Cow::Owned(c.to_string()), None => { // These are supposed to always be strings. But, if we @@ -720,7 +720,8 @@ impl SpPoller { hubris_archive_id: Cow::Owned(hubris_archive_id.clone()), slot: self.spid.slot as u32, component_kind: Cow::Owned(dev.device), - component, + component_id, + description: Cow::Owned(dev.description), }; match self.components.entry(dev.component) { // Found a new device! @@ -728,8 +729,9 @@ impl SpPoller { slog::debug!( &self.log, "discovered a new component!"; - "component" => ?dev.component, - "device" => ?target.component_kind, + "component_id" => %target.component_id, + "component_kind" => %target.component_kind, + "description" => %target.component_id, ); entry.insert(ComponentMetrics { target, diff --git a/oximeter/oximeter/schema/sensor-measurement.toml b/oximeter/oximeter/schema/sensor-measurement.toml index d2e3400da29..43cc91244c3 100644 --- a/oximeter/oximeter/schema/sensor-measurement.toml +++ b/oximeter/oximeter/schema/sensor-measurement.toml @@ -15,7 +15,8 @@ versions = [ "hubris_archive_id", "gateway_id", "component_kind", - "component", + "component_id", + "description", ]} ] @@ -59,7 +60,7 @@ What kind of thing the component resides on. This will be one of 'sled'\ for components on compute sled; 'switch', for components on rack switches; \ or 'power', for components on power shelves.""" -[fields.component] +[fields.component_id] type = "string" description = """ The service processor component ID uniquely identifying the hardware \ @@ -69,6 +70,13 @@ component on the sled, switch, or power shelf.""" type = "string" description = "What type of hardware component this thing is." +[fields.description] +type = "string" +description = """ +A human-readable description of the hardware component. This may include \ +its location or role in the system (e.g. a DIMM's number, or a temperature \ +sensor's location).""" + [fields.sensor] type = "string" description = """