Skip to content

Commit

Permalink
Add optional min and max fields to histogram data model. (#1915)
Browse files Browse the repository at this point in the history
* Add optional min and max fields to histogram data model.

* Fix lint error

* Update histogram min and max definition per discussion

* Format changelog to comply with line length recommendations

* Update delta histogram image with min and max

* Fix lint error

* Revert "Fix lint error"

This reverts commit 90f1c72

* Removing trailing space on line

Co-authored-by: Josh Suereth <[email protected]>
  • Loading branch information
jack-berg and jsuereth authored Oct 1, 2021
1 parent a43f2b2 commit 4e1f01e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ release.

### Metrics

- Add optional min / max fields to histogram data model.
([#1915](https://github.com/open-telemetry/opentelemetry-specification/pull/1915))

### Logs

### Resource
Expand Down
9 changes: 9 additions & 0 deletions specification/metrics/datamodel.md
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ Histograms consist of the following:
(00:00:00 UTC on 1 January 1970).
- A count (`count`) of the total population of points in the histogram.
- A sum (`sum`) of all the values in the histogram.
- (optional) The min (`min`) of all values in the histogram.
- (optional) The max (`max`) of all values in the histogram.
- (optional) A series of buckets with:
- Explicit boundary values. These values denote the lower and upper bounds
for buckets and whether not a given observation would be recorded in this
Expand All @@ -398,6 +400,13 @@ denotes Delta temporality where accumulated event counts are reset to zero after
and a new aggregation occurs. Cumulative, on the other hand, continues to
aggregate events, resetting with the use of a new start time.

The aggregation temporality also has implications on the min and max fields. Min
and max are more useful for Delta temporality, since the values represented by
Cumulative min and max will stabilize as more events are recorded. Additionally,
it is possible to convert min and max from Delta to Cumulative, but not from
Cumulative to Delta. When converting from Cumulative to Delta, min and max can
be dropped, or captured in an alternative representation such as a gauge.

Bucket counts are optional. A Histogram without buckets conveys a
population in terms of only the sum and count, and may be interpreted
as a histogram with single bucket covering `(-Inf, +Inf)`.
Expand Down
Binary file modified specification/metrics/img/model-delta-histogram.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4e1f01e

Please sign in to comment.