Skip to content

Commit

Permalink
Use Absolute(true/false) vs NonNegative/Signed (#312)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmacd authored and SergeyKanzhelev committed Oct 17, 2019
1 parent 9385578 commit 9fbf36f
Showing 1 changed file with 15 additions and 14 deletions.
29 changes: 15 additions & 14 deletions specification/api-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ TODO: Table of contents

## Overview

The user-facing metrics API supports reporting diagnostic measurements
The user-facing metrics API supports producing diagnostic measurements
using three basic kinds of instrument. "Metrics" are the thing being
produced--mathematical, statistical summaries of certain observable
behavior in the program. "Instruments" are the devices used by the
Expand Down Expand Up @@ -116,12 +116,13 @@ Counters support `Add(value)`. Choose this kind of metric when the
value is a quantity, the sum is of primary interest, and the event
count and value distribution are not of primary interest.

Counters are defined as monotonic by default, meaning that positive
values are expected. Monotonic counters are typically used because
they can automatically be interpreted as a rate.
Counters are defined as `Monotonic = true` by default, meaning that
positive values are expected. `Monotonic = true` counters are
typically used because they can automatically be interpreted as a
rate.

As an option, counters can be declared as `NonMonotonic`, in which
case they support positive and negative increments. Non-monotonic
As an option, counters can be declared as `Monotonic = false`, in which
case they support positive and negative increments. `Monotonic = false`
counters are useful to report changes in an accounting scheme, such as
the number of bytes allocated and deallocated.

Expand All @@ -135,12 +136,12 @@ measurement interval is arbitrary. Use this kind of metric when the
measurement is not a quantity, and the sum and event count are not of
interest.

Gauges are defined as non-monotonic by default, meaning that new
Gauges are defined as `Monotonic = false` by default, meaning that new
values are permitted to make positive or negative changes to the
gauge. There is no restriction on the sign of the input for gauges.

As an option, gauges can be declared as `Monotonic`, in which case
successive values are expected to rise monotonically. Monotonic
As an option, gauges can be declared as `Monotonic = true`, in which case
successive values are expected to rise monotonically. `Monotonic = true`
gauges are useful in reporting computed cumulative sums, allowing an
application to compute a current value and report it, without
remembering the last-reported value in order to report an increment.
Expand All @@ -163,9 +164,9 @@ count or rate of events is meaningful and either:
- The sum is of interest in addition to the count (rate)
- Quantile information is of interest.

Measures are defined as `NonNegative` by default, meaning that
negative values are invalid. Non-negative measures are typically used
to record absolute values such as durations and sizes.
Measures are defined as `Absolute = true` by default, meaning that
negative values are invalid. `Absolute = true` measures are typically
used to record absolute values such as durations and sizes.

As an option, measures can be declared as `Signed` to indicate support
for positive and negative values.
As an option, measures can be declared as `Absolute = false` to
indicate support for positive and negative values.

0 comments on commit 9fbf36f

Please sign in to comment.