prometheus/docs
beorn7 9eafed0f79 promql: Add `histogram_count` and `histogram_sum`
This follow a simple function-based approach to access the count and
sum fields of a native Histogram. It might be more elegant to
implement “accessors” via the dot operator, as considered in the
brainstorming doc [1]. However, that would require the introduction of
a whole new concept in PromQL. For the PoC, we should be fine with the
function-based approch. Even the obvious inefficiencies (rate'ing a
whole histogram twice when we only want to rate each the count and the
sum once) could be optimized behind the scenes.

Note that the function-based approach elegantly solves the problem of
detecting counter resets in the sum of observations in the case of
negative observations. (Since the whole native Histogram is rate'd,
the counter reset is detected for the Histogram as a whole.)

We will decide later if an “accessor” approach is really needed. It
would change the example expression for average duration in
functions.md from

      histogram_sum(rate(http_request_duration_seconds[10m]))
	/
      histogram_count(rate(http_request_duration_seconds[10m]))

to

      rate(http_request_duration_seconds.sum[10m])
	/
      rate(http_request_duration_seconds.count[10m])

[1]: https://docs.google.com/document/d/1ch6ru8GKg03N02jRjYriurt-CZqUVY09evPg6yKTA1s/edit

Signed-off-by: beorn7 <beorn@grafana.com>
2022-06-28 18:16:48 +02:00
..
configuration Fix a small typo (#10771) 2022-06-01 12:31:18 +10:00
images
querying promql: Add `histogram_count` and `histogram_sum` 2022-06-28 18:16:48 +02:00
feature_flags.md Log gomaxprocs messages (#10506) 2022-03-30 19:16:22 +02:00
federation.md Fix typo (#5796) 2019-07-24 10:41:14 +01:00
getting_started.md Update getting started guide with the new UI 2022-01-14 23:14:55 +02:00
http_sd.md Added a failure counter to the HTTP service discovery (#10372) 2022-03-08 14:10:45 +01:00
index.md Update prometheus.io's URL to the latest version (#5270) 2019-02-27 10:39:50 +00:00
installation.md docs: minor corrections to the docker documentation (#6869) 2020-08-31 15:44:08 +01:00
management_api.md Merge release-2.28 back into main (#8975) 2021-06-22 00:59:31 +02:00
migration.md Merge release-2.28 back into main (#8975) 2021-06-22 00:59:31 +02:00
stability.md Merge release-2.28 back into main (#8975) 2021-06-22 00:59:31 +02:00
storage.md Clarify units of --storage.tsdb.retention.size (#10154) 2022-01-13 00:55:57 +01:00