Skip to content

Commit bf906ad

Browse files
jmacdjkwatsonarminru
authored
Metrics terminology (Adding/Grouping) (open-telemetry#983)
Co-authored-by: John Watson <jkwatson@gmail.com> Co-authored-by: Armin Ruech <armin.ruech@dynatrace.com>
1 parent d7e1329 commit bf906ad

File tree

2 files changed

+57
-55
lines changed

2 files changed

+57
-55
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ Updates:
8282
and `RECORD_AND_SAMPLE` for consistency
8383
([#938](https://github.com/open-telemetry/opentelemetry-specification/pull/938),
8484
[#956](https://github.com/open-telemetry/opentelemetry-specification/pull/956))
85+
- Metrics API: Replace "Additive" with "Adding", "Non-Additive" with "Grouping"
86+
([#983](https://github.com/open-telemetry/opentelemetry-specification/pull/983)
8587
- Move active span interaction in the Trace API to a separate class
8688
([#923](https://github.com/open-telemetry/opentelemetry-specification/pull/923))
8789
- Metrics SDK: Specify LastValue default aggregation for ValueObserver

specification/metrics/api.md

+55-55
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- [Instrument properties](#instrument-properties)
1919
* [Instrument naming requirements](#instrument-naming-requirements)
2020
* [Synchronous and asynchronous instruments compared](#synchronous-and-asynchronous-instruments-compared)
21-
* [Additive and non-additive instruments compared](#additive-and-non-additive-instruments-compared)
21+
* [Adding and grouping instruments compared](#adding-and-grouping-instruments-compared)
2222
* [Monotonic and non-monotonic instruments compared](#monotonic-and-non-monotonic-instruments-compared)
2323
* [Function names](#function-names)
2424
- [The instruments](#the-instruments)
@@ -110,24 +110,24 @@ has put effort into taking some kind of measurement. For both
110110
performance and semantic reasons, the API let users choose between two
111111
kinds of measurement.
112112

113-
The term _additive_ is used to specify a characteristic of some
113+
The term _adding_ is used to specify a characteristic of some
114114
measurements, meant to indicate that only the sum is considered useful
115115
information. These are measurements that you would naturally combine
116116
using arithmetic addition, usually real quantities of something
117117
(e.g., number of bytes).
118118

119-
Non-additive measurements are used when the set of values, also known
119+
Grouping measurements are used when the set of values, also known
120120
as the population, is presumed to have useful information. A
121-
non-additive measurement is either one that you would not naturally
121+
grouping measurement is either one that you would not naturally
122122
combine using arithmetic addition (e.g., request latency), or it is a
123123
measurement you would naturally add where the intention is to monitor
124124
the distribution of values (e.g., queue size). The median value is
125-
considered useful information for non-additive measurements.
125+
considered useful information for grouping measurements.
126126

127-
Non-additive instruments semantically capture more information than
128-
additive instruments. Non-additive measurements are more expensive
129-
than additive measurements, by this definition. Users will choose
130-
additive instruments except when they expect to get value from the
127+
Grouping instruments semantically capture more information than
128+
adding instruments. Grouping measurements are more expensive
129+
than adding measurements, by this definition. Users will choose
130+
adding instruments except when they expect to get value from the
131131
additional cost of information about individual values. None of this
132132
is to prevent an SDK from re-interpreting measurements based on
133133
configuration. Anything can happen with any kind of measurement.
@@ -149,13 +149,13 @@ Instruments are classified in several ways that distinguish them from
149149
one another.
150150

151151
1. Synchronicity: A synchronous instrument is called by the user in a distributed [Context](../context/context.md) (i.e., Span context, Baggage). An asynchronous instrument is called by the SDK once per collection interval, lacking a Context.
152-
2. Additivity: An additive instrument is one that records additive measurements, as described above.
153-
3. Monotonicity: A monotonic instrument is an additive instrument, where the progression of each sum is non-decreasing. Monotonic instruments are useful for monitoring rate information.
152+
2. Adding vs. Grouping: An adding instrument is one that records adding measurements, as opposed to a grouping instrument as described above.
153+
3. Monotonicity: A monotonic instrument is an adding instrument, where the progression of sums is non-decreasing. Monotonic instruments are useful for monitoring rate information.
154154

155155
The metric instruments names are shown below along with whether they
156-
are synchronous, additive, and/or monotonic.
156+
are synchronous, adding, and/or monotonic.
157157

158-
| Name | Synchronous | Additive | Monotonic |
158+
| Name | Synchronous | Adding | Monotonic |
159159
| ---- | ----------- | -------- | --------- |
160160
| Counter | Yes | Yes | Yes |
161161
| UpDownCounter | Yes | Yes | No |
@@ -170,13 +170,13 @@ useful when measurements are expensive, therefore should be gathered
170170
periodically. Read more [characteristics of synchronous and
171171
asynchronous instruments](#synchronous-and-asynchronous-instruments-compared) below.
172172

173-
The synchronous and asynchronous additive instruments have a
173+
The synchronous and asynchronous adding instruments have a
174174
significant difference: synchronous instruments are used to capture
175175
changes in a sum, whereas asynchronous instruments are used to capture
176-
sums directly. Read more [characteristics of additive
177-
instruments](#additive-and-non-additive-instruments-compared) below.
176+
sums directly. Read more [characteristics of adding
177+
instruments](#adding-and-grouping-instruments-compared) below.
178178

179-
The monotonic additive instruments are significant because they support rate
179+
The monotonic adding instruments are significant because they support rate
180180
calculations. Read more information about [choosing metric
181181
instruments](#monotonic-and-non-monotonic-instruments-compared) below.
182182

@@ -242,7 +242,7 @@ give users an understanding of how it is meant to be used.
242242
Instruments, in the absence of any configuration override, can be
243243
expected to deliver a useful, economical aggregation out of the box.
244244

245-
The additive instruments (`Counter`, `UpDownCounter`, `SumObserver`,
245+
The adding instruments (`Counter`, `UpDownCounter`, `SumObserver`,
246246
`UpDownSumObserver`) use a Sum aggregation by default. Details about
247247
computing a Sum aggregation vary, but from the user's perspective this
248248
means they will be able to monitor the sum of values captured. The
@@ -258,7 +258,7 @@ The `ValueObserver` instrument uses LastValue aggregation by default.
258258
This aggregation keeps track of the last value that was observed and
259259
its timestamp.
260260

261-
Other standard aggregations are available, especially for non-additive
261+
Other standard aggregations are available, especially for grouping
262262
instruments, where we are generally interested in a variety of
263263
different summaries, such as histograms, quantile summaries,
264264
cardinality estimates, and other kinds of sketch data structure.
@@ -439,35 +439,35 @@ corresponding to the instrument and label set. (For this reasons,
439439
SDKs SHOULD run asynchronous instrument callbacks near the end of the
440440
collection interval.)
441441

442-
### Additive and non-additive instruments compared
442+
### Adding and grouping instruments compared
443443

444-
Additive instruments are used to capture information about a sum,
444+
Adding instruments are used to capture information about a sum,
445445
where, by definition, only the sum is of interest. Individual events
446446
are considered not meaningful for these instruments, the event count
447447
is not computed. This means, for example, that two `Counter` events
448448
`Add(N)` and `Add(M)` are equivalent to one `Counter` event `Add(N +
449449
M)`. This is the case because `Counter` is synchronous, and
450-
synchronous additive instruments are used to capture changes to a sum.
450+
synchronous adding instruments are used to capture changes to a sum.
451451

452-
Asynchronous, additive instruments (e.g., `SumObserver`) are used to
452+
Asynchronous, adding instruments (e.g., `SumObserver`) are used to
453453
capture sums directly. This means, for example, that in any sequence
454454
of `SumObserver` observations for a given instrument and label set,
455455
the Last Value defines the sum of the instrument.
456456

457-
In both synchronous and asynchronous cases, the additive instruments
457+
In both synchronous and asynchronous cases, the adding instruments
458458
are inexpensively aggregated into a single number per collection interval
459-
without loss of information. This property makes additive instruments
460-
higher performance, in general, than non-additive instruments.
459+
without loss of information. This property makes adding instruments
460+
higher performance, in general, than grouping instruments.
461461

462-
Non-additive instruments use a relatively inexpensive aggregation,
462+
Grouping instruments use a relatively inexpensive aggregation,
463463
by default, compared with recording full data, but still more expensive aggregation than the
464-
default for additive instruments (Sum). Unlike additive instruments,
465-
where only the sum is of interest by definition, non-additive
464+
default for adding instruments (Sum). Unlike adding instruments,
465+
where only the sum is of interest by definition, grouping
466466
instruments can be configured with even more expensive aggregators.
467467

468468
### Monotonic and non-monotonic instruments compared
469469

470-
Monotonicity applies only to additive instruments. `Counter` and
470+
Monotonicity applies only to adding instruments. `Counter` and
471471
`SumObserver` instruments are defined as monotonic because the sum
472472
captured by either instrument is non-decreasing. The `UpDown-`
473473
variations of these two instruments are non-monotonic, meaning the sum
@@ -483,10 +483,10 @@ Non-increasing sums are not considered a feature in the Metric API.
483483
Each instrument supports a single function, named to help convey the
484484
instrument's semantics.
485485

486-
Synchronous additive instruments support an `Add()` function,
486+
Synchronous adding instruments support an `Add()` function,
487487
signifying that they add to a sum and do not directly capture a sum.
488488

489-
Synchronous non-additive instruments support a `Record()` function,
489+
Synchronous grouping instruments support a `Record()` function,
490490
signifying that they capture individual events, not only a sum.
491491

492492
Asynchronous instruments all support an `Observe()` function,
@@ -499,7 +499,7 @@ signifying that they capture only one value per measurement interval.
499499
`Counter` is the most common synchronous instrument. This instrument
500500
supports an `Add(increment)` function for reporting a sum, and is
501501
restricted to non-negative increments. The default aggregation is
502-
`Sum`, as for any additive instrument.
502+
`Sum`, as for any adding instrument.
503503

504504
Example uses for `Counter`:
505505

@@ -535,17 +535,17 @@ levels across a group of processes.
535535

536536
### ValueRecorder
537537

538-
`ValueRecorder` is a non-additive synchronous instrument useful for
539-
recording any non-additive number, positive or negative. Values
538+
`ValueRecorder` is a grouping synchronous instrument useful for
539+
recording any grouping number, positive or negative. Values
540540
captured by a `Record(value)` are treated as individual events
541541
belonging to a distribution that is being summarized. `ValueRecorder`
542542
should be chosen either when capturing measurements that do not
543543
contribute meaningfully to a sum, or when capturing numbers that are
544-
additive in nature, but where the distribution of individual
544+
adding in nature, but where the distribution of individual
545545
increments is considered interesting.
546546

547547
One of the most common uses for `ValueRecorder` is to capture latency
548-
measurements. Latency measurements are not additive in the sense that
548+
measurements. Latency measurements are not adding in the sense that
549549
there is little need to know the latency-sum of all processed
550550
requests. We use a `ValueRecorder` instrument to capture latency
551551
measurements typically because we are interested in knowing mean,
@@ -556,32 +556,32 @@ maximum values, the sum of event values, and the count of events,
556556
allowing the rate, the mean, and range of input values to be
557557
monitored.
558558

559-
Example uses for `ValueRecorder` that are non-additive:
559+
Example uses for `ValueRecorder` that are grouping:
560560

561561
- capture any kind of timing information
562562
- capture the acceleration experienced by a pilot
563563
- capture nozzle pressure of a fuel injector
564564
- capture the velocity of a MIDI key-press.
565565

566-
Example _additive_ uses of `ValueRecorder` capture measurements that
567-
are additive, but where we may have an interest in the distribution of
566+
Example _adding_ uses of `ValueRecorder` capture measurements that
567+
are adding, but where we may have an interest in the distribution of
568568
values and not only the sum:
569569

570570
- capture a request size
571571
- capture an account balance
572572
- capture a queue length
573573
- capture a number of board feet of lumber.
574574

575-
These examples show that although they are additive in nature,
575+
These examples show that although they are adding in nature,
576576
choosing `ValueRecorder` as opposed to `Counter` or `UpDownCounter`
577577
implies an interest in more than the sum. If you did not care to
578578
collect information about the distribution, you would have chosen one
579-
of the additive instruments instead. Using `ValueRecorder` makes
579+
of the adding instruments instead. Using `ValueRecorder` makes
580580
sense for capturing distributions that are likely to be important in
581581
an observability setting.
582582

583583
Use these with caution because they naturally cost more than the use
584-
of additive measurements.
584+
of adding measurements.
585585

586586
### SumObserver
587587

@@ -631,7 +631,7 @@ would be impractical to instrument them, use a `UpDownSumObserver`.
631631
### ValueObserver
632632

633633
`ValueObserver` is the asynchronous instrument corresponding to
634-
`ValueRecorder`, used to capture non-additive measurements with
634+
`ValueRecorder`, used to capture grouping measurements with
635635
`Observe(value)`. These instruments are especially useful for
636636
capturing measurements that are expensive to compute, since it gives
637637
the SDK control over how often they are evaluated.
@@ -641,9 +641,9 @@ Example uses for `ValueObserver`:
641641
- capture CPU fan speed
642642
- capture CPU temperature.
643643

644-
Note that these examples use non-additive measurements. In the
644+
Note that these examples use grouping measurements. In the
645645
`ValueRecorder` case above, example uses were given for capturing
646-
synchronous additive measurements during a request (e.g.,
646+
synchronous adding measurements during a request (e.g.,
647647
current queue size seen by a request). In the asynchronous case,
648648
however, how should users decide whether to use `ValueObserver` as
649649
opposed to `UpDownSumObserver`?
@@ -680,7 +680,7 @@ How are the instruments fundamentally different, and why are there
680680
only three? Why not one instrument? Why not ten?
681681

682682
As we have seen, the instruments are categorized as to whether
683-
they are synchronous, additive, and/or and monotonic. This approach
683+
they are synchronous, adding, and/or and monotonic. This approach
684684
gives each of the instruments unique semantics, in ways that
685685
meaningfully improve the performance and interpretation of metric
686686
events.
@@ -690,21 +690,21 @@ most cases it allows the SDK to provide good default functionality
690690
"out of the box", without requiring alternative behaviors to be
691691
configured. The choice of instrument determines not only the meaning
692692
of the events but also the name of the function called by the user.
693-
The function names--`Add()` for additive instruments, `Record()` for
694-
non-additive instruments, and `Observe()` for asynchronous
693+
The function names--`Add()` for adding instruments, `Record()` for
694+
grouping instruments, and `Observe()` for asynchronous
695695
instruments--help convey the meaning of these actions.
696696

697697
The properties and standard implementation described for the
698698
individual instruments is summarized in the table below.
699699

700700
| **Name** | Instrument kind | Function(argument) | Default aggregation | Notes |
701701
| ----------------------- | ----- | --------- | ------------- | --- |
702-
| **Counter** | Synchronous additive monotonic | Add(increment) | Sum | Per-request, part of a monotonic sum |
703-
| **UpDownCounter** | Synchronous additive | Add(increment) | Sum | Per-request, part of a non-monotonic sum |
704-
| **ValueRecorder** | Synchronous | Record(value) | [TBD issue 636](https://github.com/open-telemetry/opentelemetry-specification/issues/636) | Per-request, any non-additive measurement |
705-
| **SumObserver** | Asynchronous additive monotonic | Observe(sum) | Sum | Per-interval, reporting a monotonic sum |
706-
| **UpDownSumObserver** | Asynchronous additive | Observe(sum) | Sum | Per-interval, reporting a non-monotonic sum |
707-
| **ValueObserver** | Asynchronous | Observe(value) | LastValue | Per-interval, any non-additive measurement |
702+
| **Counter** | Synchronous adding monotonic | Add(increment) | Sum | Per-request, part of a monotonic sum |
703+
| **UpDownCounter** | Synchronous adding | Add(increment) | Sum | Per-request, part of a non-monotonic sum |
704+
| **ValueRecorder** | Synchronous | Record(value) | [TBD issue 636](https://github.com/open-telemetry/opentelemetry-specification/issues/636) | Per-request, any grouping measurement |
705+
| **SumObserver** | Asynchronous adding monotonic | Observe(sum) | Sum | Per-interval, reporting a monotonic sum |
706+
| **UpDownSumObserver** | Asynchronous adding | Observe(sum) | Sum | Per-interval, reporting a non-monotonic sum |
707+
| **ValueObserver** | Asynchronous | Observe(value) | LastValue | Per-interval, any grouping measurement |
708708

709709
### Constructors
710710

0 commit comments

Comments
 (0)