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

Make celsius recommendation more nuanced #1648

Merged
merged 1 commit into from Jun 2, 2020
Merged

Make celsius recommendation more nuanced #1648

merged 1 commit into from Jun 2, 2020

Conversation

beorn7
Copy link
Member

@beorn7 beorn7 commented May 28, 2020

Triggered by prometheus/client_golang#761

Signed-off-by: beorn7 beorn@grafana.com

Copy link
Contributor

@mdlayher mdlayher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@brian-brazil
Copy link
Contributor

I strong disagree with this PR. The whole point of base units is that there is exactly one of them. If someone wishes to not follow best practice we can't stop them, but that doesn't mean we should then explicitly endorse breaking of best practices.

For example should we allow bits, given that far more network engineers who typically work in bits use Prometheus, and their use cases are more in line with the general category systems monitoring that Prometheus is intended for?

@beorn7
Copy link
Member Author

beorn7 commented May 28, 2020

I think bits/bytes is a borderline case, too, but for other reasons. For one, it is in fact a constant source of confusion because there are many cases where you have to ask yourself if that number is bits or bytes. That's different for Kelvin/Celsius, where the domains are usually clearly separated (nobody would assume Celsius if talking about color temperature or if calculating a Boltzmann factor).

Also, bit/byte is converted by the multiplication of a number everyone knows from the top of their head, but Kelvin/Celsius is an addition by a number that only a small fraction of Prometheus users know from the top of their head. But I wrote that already in prometheus/client_golang#761 . There are only so many arguments to make here, and we are repeating them already. Time to vote.

@@ -75,7 +75,7 @@ The list is not exhaustive.
| Family | Base unit | Remark |
| -------| --------- | ------ |
| Time | seconds | |
| Temperature | celsius | _celsius_ is preferred over _kelvin_ for practical reasons. |
| Temperature | celsius | _celsius_ is preferred over _kelvin_ for practical reasons. _kelvin_ is acceptable in special cases like color temperature and scientific usage. |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This contradicts the docs at https://prometheus.io/docs/instrumenting/writing_exporters/#naming 6th paragraph. The simplest fix would be replacing must with should, though I think it'd be better to expand that paragraph a little explaining where it can be okay to do things like this (i.e. extremely unlikely to end up mixing units down the line) rather than changing here.

"Scientific usage" is also a bit vague - does that include all environmental/weather monitoring for example? I'd leave things to the concrete example of monitor color temperature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we maybe have a category "Color temperature and Science"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For such a relatively rare case, that seems a bit much. Science is also still a bit vague, e.g. I've attempted science many times with machine temperature (turns out it was dodgy RAM).

Copy link
Member Author

@beorn7 beorn7 Jun 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really a contradiction because kelvin would be the proper base unit in those examples. I changed the remark in this PR to use the word "base unit", although I'm torn if this formal correctness is really worth making the remark more verbose.

A verbose explanation when multiple base units are appropriate (in https://prometheus.io/docs/instrumenting/writing_exporters/#naming ) is IMHO more confusing than helpful, as the case is very rare (so far, temperature is the only one). It would probably just trigger people to shoehorn the case of their own favorite unit into this line of argument. I suggest to just leave it with temperature here. Should anyone ever bring up the temperature example as a reason to push another alternative base unit, we could still expand on the underlying reasoning.

I deliberately added the "scientific usage" because I think it's important. I kept it deliberately vague for the sake of brevity, given that this is merely inside a remark. I don't think there is any danger that anybody will feel compelled to convert the readings from their weather monitoring device into K. However, there is a danger that somebody that needs to calculate Boltzmann factors will feel compelled to use °C if we only mention the color temperature case.

In the hope to address your comments, I have extended the remark in my latest push. My problem with it is that the remark is now much longer without any practical impact. It is mostly there to address your rather formal concerns, which in my personal opinion have little impact on what people will actually do. However, I'm willing to take the leap of faith that this longer remark is more beneficial than harmful.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be internally-self consistent now.

It would probably just trigger people to shoehorn the case of their own favorite unit into this line of argument.

That's my primary concern with all of this.

Triggered by prometheus/client_golang#761

Signed-off-by: beorn7 <beorn@grafana.com>
Copy link
Contributor

@mdlayher mdlayher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brian-brazil
Copy link
Contributor

👍

@beorn7 beorn7 merged commit 3badba8 into master Jun 2, 2020
@beorn7 beorn7 deleted the beorn7/practices branch June 2, 2020 18:18
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.

None yet

4 participants