Skip to content

Commit

Permalink
add component descriptions to target
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkw committed Aug 21, 2024
1 parent 50fac09 commit bd86ce7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
10 changes: 6 additions & 4 deletions gateway/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -720,16 +720,18 @@ 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!
hash_map::Entry::Vacant(entry) => {
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,
Expand Down
12 changes: 10 additions & 2 deletions oximeter/oximeter/schema/sensor-measurement.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ versions = [
"hubris_archive_id",
"gateway_id",
"component_kind",
"component",
"component_id",
"description",
]}
]

Expand Down Expand Up @@ -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 \
Expand All @@ -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 = """
Expand Down

0 comments on commit bd86ce7

Please sign in to comment.