-
Notifications
You must be signed in to change notification settings - Fork 93
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
Metrics do not follow metric naming best practices about units #121
Comments
I was puzzled by this too so i refreshed my memory from the smart standard. from the man pages: Each Attribute has a "Raw" value, printed under the heading "RAW_VALUE", and a "Normalized" value printed under the heading "VALUE". [Note: smartctl prints these values in base-10.] In the example just given, the "Raw Value" for Attribute 12 would be the actual number of times that the disk has been power-cycled, for example 365 if the disk has been turned on once per day for exactly one year. Each vendor uses their own algorithm to convert this "Raw" value to a "Normalized" value in the range from 1 to 254. Please keep in mind that smartctl only reports the different Attribute types, values, and thresholds as read from the device. It does not carry out the conversion between "Raw" and "Normalized" values: this is done by the disk's firmware. The conversion from Raw value to a quantity with physical units is not specified by the SMART standard. In most cases, the values printed by smartctl are sensible. For example the temperature Attribute generally has its raw value equal to the temperature in Celsius. However in some cases vendors use unusual conventions. For example the Hitachi disk on my laptop reports its power-on hours in minutes, not hours. Some IBM disks track three temperatures rather than one, in their raw values. And so on. EDIT (for extra info): You can strip the Example: json for an SATA disk may report:
The type is just a name. |
Prometheus’ metric and label naming best practices recommend:
Furthermore, it has a table with base units that specifies:
Currently
smartctl_exporter
does not follow these best practices. A few metrics that can be improved are:smartctl_device_block_size
could besmartctl_device_block_size_bytes
smartctl_device_interface_speed
could besmartctl_device_interface_speed_bps
orsmartctl_device_interface_speed_bits_per_second
smartctl_device_rotation_rate
could besmartctl_device_rotation_rate_rpm
(I suppose a really strict interpretation of the guidelines would be to convert the rotations per minute to radians per second or Hertz, but since RPM is the standard measure of rotation rate, I would keep it at that)smartctl_device_temperature
could besmartctl_device_temperature_celsius
(thanks for at least putting the unit in the documentation by the way!)Renaming these metrics would be a breaking change, but I think it is worth considering, because when adoption continues to grow, the aggregate upside to new users will be greater than the downside to current users. A compromise might be to expose the renamed metrics under both the old and new name for one or more releases.
The text was updated successfully, but these errors were encountered: