Skip to content

Document histograms and histogram_quantile. #43

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

Merged
merged 4 commits into from
Mar 3, 2015
Merged

Conversation

beorn7
Copy link
Member

@beorn7 beorn7 commented Feb 24, 2015

for latency, for example). Note that the number of observations (showing up in
Prometheus as a time series with a `_count` suffix) is inherently a counter (as
described above, it only goes up), while the sum of observations (showing up as
a time series with a `_sum` suffix) is inherently a gauge (if a negative value
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a bit messy, the cases where it won't be a counter are very small - and in that case the _sum is of questionable use.

Copy link
Member Author

Choose a reason for hiding this comment

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

In the next commit, I'll try to make the usual case clearer without denying the possibility of negative observations.

@beorn7
Copy link
Member Author

beorn7 commented Feb 25, 2015

I'll comment and rework the text ASAP. Just very busy with other stuff right now. Will get back to this tomorrow or so.

vs. histogram](/docs/practices/instrumentation/#summary-vs.-histogram) for
details of histogram usage and differences to [summaries](#summary).

Client library usage documentation for summaries:
Copy link
Member

Choose a reason for hiding this comment

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

s/for summaries/for histograms/

Copy link
Member Author

Choose a reason for hiding this comment

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

done.

@beorn7
Copy link
Member Author

beorn7 commented Feb 26, 2015

Still polishing.... commit might only happen tonight. Stay tuned. :)

@beorn7 beorn7 force-pushed the beorn7/doc-improve branch 2 times, most recently from c7496e6 to 6efe3d3 Compare March 2, 2015 16:16
@beorn7
Copy link
Member Author

beorn7 commented Mar 2, 2015

Sorry for the longer-then-expected delay... Here is the heavily reworked version.

Most importantly, I have created a completely new section for the delicate subject of histograms and
summaries and updated all the references.

# Histograms and summaries

Histograms and summaries are more complex metric types. Not only
creates a single histogram or summary a multitude of time series, it
Copy link
Contributor

Choose a reason for hiding this comment

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

Grammar is off here

Copy link
Member Author

Choose a reason for hiding this comment

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

In which way? Need language assistance...

Copy link
Member

Choose a reason for hiding this comment

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

"Not only creates a single histogram" is missing a subject, or at least it seems that way, because I think you mean "histogram or summary" to be the subject, but the location they appear in makes them seem like the object.

Probably you want to say "Not only do they create a multitude of time series, it is also ..."

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Well, also the subject is in the wrong position, and the verb is not conjugated correctly? I would just copy my suggestion :)

Copy link
Member Author

Choose a reason for hiding this comment

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

"a single histogram or summary" is clearly singular. A "does" was missing, and then "creates" becomes infinite and goes to a different place. The subject was correctly placed from the beginning.

Should be good now.

cannot apply `rate()` to it anymore.

To calculate the average request duration during the last 5 minutes
from a histogram or summary called `http_request_duration_second`, use
Copy link
Member

Choose a reason for hiding this comment

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

s/http_request_duration_second/http_request_duration_seconds/

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.


The essential difference between summaries and histograms is that summaries
calculate streaming φ-quantiles on the client side and expose them directly,
while histograms expose bucketed observations counts and the calculation of
Copy link
Member

Choose a reason for hiding this comment

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

"observations counts" -> "observation counts"

Copy link
Member Author

Choose a reason for hiding this comment

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

DOne.

@beorn7 beorn7 force-pushed the beorn7/doc-improve branch from 715b75b to 924cad3 Compare March 3, 2015 11:53
@beorn7
Copy link
Member Author

beorn7 commented Mar 3, 2015

PHAL

@juliusv
Copy link
Member

juliusv commented Mar 3, 2015

👍

beorn7 added 4 commits March 3, 2015 18:19
Most importantly, created a completely new section for histograms and
summaries and updated all the references.

Also add other minor improvements.
@beorn7 beorn7 force-pushed the beorn7/doc-improve branch from 924cad3 to c532c7f Compare March 3, 2015 17:23
juliusv added a commit that referenced this pull request Mar 3, 2015
Document histograms and histogram_quantile.
@juliusv juliusv merged commit 1e182ed into master Mar 3, 2015
@juliusv juliusv deleted the beorn7/doc-improve branch March 3, 2015 17:23
krajorama added a commit that referenced this pull request Apr 18, 2025
OM1.0 required that the Sum of Histograms is not represented when there
are negative observations in a histogram.

This PR is removing this requirement in OM2.0. Due to:
The requirement was never implemented by the Go and Java instrumentation
  libraries. Enforcing it now would be breaking.
The requirement makes it impossible to implement the use case where the
user wants to measure the Sum anyway.
We already warned users in the documentation about the possibility of
Sum decreasing and not being usable for rate() 10 years ago: #43.
And native histograms will not take Sum into account when calculating
counter resets during rate() , thus this problem won't come up.

Note: this PR does not make Sum mandatory, that is a different question.

Signed-off-by: György Krajcsovits <[email protected]>
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.

3 participants