Skip to content

Want sled identifiers on most (all?) timeseries #5267

Open
@bnaecker

Description

@bnaecker

Most timeseries today do not include information about the sled from which they're derived. They should! The physical data link stats are one example. They include the sled's UUID and serial right now. But serial numbers are only unique within a part number, and so we'd probably want to add the part and revision to these as well.

Note that this is probably not restricted just to physical or host-specific timeseries. For example, it would be very useful to understand Crucible virtual disk write statistics broken down by the host sled. Ditto for vCPU data, or VNIC usage (both guest and host).

Implementation note

The oximeter derive-macros for implementing Target and Metric could benefit from a bit more care. I've experimented previously with adding units through attributes, for example. One improvement that could help implement this current issue is something like #[serde(flatten)] or #[diesel(embed)], i.e., a way to include some other struct and its fields in this one. We could then make a set of consistent, widely-used targets in a place like oximeter-instruments, for including common fields. So something like:

/// Shared identifiers for a sled
struct Sled {
    part: String,
    revision: String,
    serial: String,
    id: Uuid,
}

#[derive(oximeter::Target)]
struct SomeTarget {
    #[oximeter(embed)]
    sled: Sled,
}

One option here, though it's a bit magical, might be to prefix the field names of the embedded struct with the field name in the containing struct. So the fields for SomeTarget would be "sled_part", "sled_revision", etc.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions