-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix hardware metrics markdown? #258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the aggregation of hw.errors
and hw.status
over different hardware types is meaningful, we should keep it under the same metric. Thank you!
@@ -93,11 +93,11 @@ Examples: physical server, switch or disk array. | |||
**Description:** A battery in a computer system or an UPS. | |||
|
|||
| Name | Description | Units | Instrument Type ([*](/docs/general/metrics.md#instrument-types)) | Value Type | Attribute Key(s) | Attribute Values | | |||
| ------------------------- | ----------------------------------------------------------------------------- | ----- | ------------------------------------------------- | ---------- | --------------------------------------------------------------------------- | ----------------------------------------------------- | | |||
|---------------------------| ----------------------------------------------------------------------------- | ----- | ------------------------------------------------- | ---------- | --------------------------------------------------------------------------- | ----------------------------------------------------- | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this change is made on purpose (other columns don't follow the same pattern), and same for other similar changes in table formatting.
| `hw.battery.charge` | Remaining fraction of battery charge | 1 | Gauge | Double | | | | ||
| `hw.battery.charge.limit` | Lower limit of battery charge fraction to ensure proper operation | 1 | Gauge | Double | `limit_type` (Recommended) | `critical`, `throttled`, `degraded` | | ||
| `hw.battery.time_left` | Time left before battery is completely charged or discharged | s | Gauge | Int | `state` (Conditionally Required, if the battery is charging or discharging) | `charging`, `discharging` | | ||
| `hw.status` | Operational status: `1` (true) or `0` (false) for each of the possible states | | UpDownCounter | Int | `state` (**Required**) | `ok`, `degraded`, `failed`, `charging`, `discharging` | | ||
| `hw.battery.status` | Operational status: `1` (true) or `0` (false) for each of the possible states | | UpDownCounter | Int | `state` (**Required**) | `ok`, `degraded`, `failed`, `charging`, `discharging` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, there is absolutely no need to use namespaces everywhere.
It's much easier to query hw.status{state="failed"}
to cover all devices, rather than hw.battery.status{state="failed"} + hw.cpu.status{state="failed"} + hw.memory.status{state="failed"} + ...
Same goes for all metrics that are common to different classes of hardware devices.
BTW, the very first version of the specification used namespaces heavily, and we simplified it and I think it's great. Let's not go backward and get it more complicated.
got it, should I remove all the duplicate definitions of |
@trask You could remove the duplicate definitions (i.e. the description and unit). However, I recommend that |
ok thanks for answering my questions @bertysentry, I'm going to close this, I suspect it may need to be revisited when converting the hardware metrics to yaml anyways (my understanding is that there can only be a single definition of the metric in yaml) |
@trask I guess you meant there can only be a single attribute definition in yaml? If so, yes that is correct. if, for example, BUT: If the attribute has different a different semantic/meaning/values on different metrics, then we are going to run into problems, as via @bertysentry since you worked on this initially, can you answer if such attributes have the same meaning across all metrics they are used? That will help when migrating this conventions to YAML. |
@joaopgrassi The attributes do have the same meaning across all device types. However, we may want to add an additional values that are specific a type of device. Example: we may want to specify the value In any case, we shouldn't add namespaces because of the tooling (YAML to Markdown)! 😅 |
I see, thanks for checking. If the attributes that are "common" have the same semantic meaning in all metrics it should be fine then leaving as is - they are already in the But we still have the problem that re-defining enum values (or overwriting them) is currently not supported. So, if we want to keep the attribute as today, we would need to implement it open-telemetry/weaver#479 before we migrate these conventions to YAML. |
@joaopgrassi |
A my mistake, I see it now. I thought it was just an attribute repeated over other metrics. Then it's really a problem. I see that The only solution I can see is: Don't include |
@joaopgrassi Thank you for the clarification! I insist that we will not add a different namespace for each device type for the Any chance we can add this ability to the yaml-2-markdown converter? |
Well, everything is possible if we want to do it 😁 , the question is more if it makes sense. The tool today is heavily structured around unique ids to avoid clashes which makes sense to me. I think we can get away with it by doing what I mentioned above and have a mix of automatic vs manual things in the markdown. |
I may not have understood something here, but figured I'd send this PR to find out.