Skip to content
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

Follow prometheus metric name best practices #67

Merged
merged 2 commits into from
Jun 9, 2019
Merged

Follow prometheus metric name best practices #67

merged 2 commits into from
Jun 9, 2019

Conversation

nickbabcock
Copy link
Owner

Breaking Change for Prometheus: OhmGraphite has not been following Prometheus best practices when it came to naming metrics. Metric names now look like "ohm_cpu_celsius" with only the "hardware" and "sensor" labels remaining. The following changes have been implemented:

  • app metric label has been removed in favor of a metric namespace prefix of "ohm"
  • hardware_type metric label has been removed in favor of encapsulating it into the metric name (eg: "cpu", "nic").
  • sensor_index metric label has been removed. This label proved superfluous as every sensor can be uniquely identified by it's name.
  • host metric label has been removed: This falls in line with other prometheus exporters like node_exporter, which does not export the host as a label.
  • base unit included in metric name (like "bytes", "revolutions per minute", etc)
  • The value that is exported to Prometheus is now converted into base units, such as converting GB (2^30) and MB (2^20) into bytes, MHz into hertz. Other units are unaffected. There are two candidates for this conversion that were unaffected:
    • Flow rate is still liters per hour, even though liters per second may seem more "base-unity", but grafana contained the former but not the latter.
    • Fan speed remains revolutions per minute, as I'm unaware of any manufacturer reporting fan speed as revolutions per second.
  • Side note: OhmGraphite now follows the official data model naming scheme by replacing invalid characters with an underscore.

Thanks @henriquegemignani for kicking off the initial work, let me know if you think this change is worse / better.

I'll let this PR linger for a little bit to allow for a potential discussion.

**Breaking Change for Prometheus**: OhmGraphite has not been following [Prometheus best practices](https://prometheus.io/docs/practices/naming/) when it came to naming metrics. Metric names now look like "ohm_cpu_celsius" with only the "hardware" and "sensor" labels remaining. The following changes have been implemented:
  * `app` metric label has been removed in favor of a metric namespace prefix of "ohm"
  * `hardware_type` metric label has been removed in favor of encapsulating it into the metric name (eg: "cpu", "nic").
  * `sensor_index` metric label has been removed. This label proved superfluous as every sensor can be uniquely identified by it's name.
  * `host` metric label has been removed: This falls in line with other prometheus exporters like node_exporter, which does not export the host as a label.
  * base unit included in metric name (like "bytes", "revolutions per minute", etc)
  * The value that is exported to Prometheus is now converted into base units, such as converting GB (2^30) and MB (2^20) into bytes, MHz into hertz. Other units are unaffected. There are two candidates for this conversion that were unaffected:
    - Flow rate is still liters per hour, even though liters per second may seem more "base-unity", but grafana contained the former but not the latter.
    - Fan speed remains revolutions per minute, as I'm unaware of any manufacturer reporting fan speed as revolutions per second.
  * Side note: OhmGraphite now follows the [official data model naming scheme](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels) by replacing invalid characters with an underscore.
@henriquegemignani
Copy link
Contributor

Seems pretty good for me! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants