Skip to content

Commit 704ed2b

Browse files
committed
tweak toc
1 parent 15d42b2 commit 704ed2b

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

docs/metrics.md

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
* [Pre-Aggregation](#pre-aggregation)
2020
* [Pre-Aggregation Benefits](#pre-aggregation-benefits)
2121
* [Cardinality Limits](#cardinality-limits)
22-
* [Cardinality Limit - Implications](#cardinality-limit---implications)
22+
* [Cardinality Limits - Implications](#cardinality-limits---implications)
23+
* [Cardinality Limits - Example](#cardinality-limits---example)
2324
* [Memory Preallocation](#memory-preallocation)
2425
* [Metrics Correlation](#metrics-correlation)
2526
* [Modelling Metric Attributes](#modelling-metric-attributes)
@@ -283,14 +284,14 @@ Temporality](https://github.com/open-telemetry/opentelemetry-specification/blob/
283284

284285
* (T0, T1]
285286
* attributes: {name = `apple`, color = `red`}, count: `1`
286-
* attributes: {verb = `lemon`, color = `yellow`}, count: `2`
287+
* attributes: {name = `lemon`, color = `yellow`}, count: `2`
287288
* (T0, T2]
288289
* attributes: {name = `apple`, color = `red`}, count: `1`
289-
* attributes: {verb = `lemon`, color = `yellow`}, count: `2`
290+
* attributes: {name = `lemon`, color = `yellow`}, count: `2`
290291
* (T0, T3]
291292
* attributes: {name = `apple`, color = `red`}, count: `6`
292293
* attributes: {name = `apple`, color = `green`}, count: `2`
293-
* attributes: {verb = `lemon`, color = `yellow`}, count: `12`
294+
* attributes: {name = `lemon`, color = `yellow`}, count: `12`
294295

295296
Note that the start time is not advanced, and the exported values are the
296297
cumulative total of what happened since the beginning.
@@ -302,13 +303,13 @@ Temporality](https://github.com/open-telemetry/opentelemetry-specification/blob/
302303

303304
* (T0, T1]
304305
* attributes: {name = `apple`, color = `red`}, count: `1`
305-
* attributes: {verb = `lemon`, color = `yellow`}, count: `2`
306+
* attributes: {name = `lemon`, color = `yellow`}, count: `2`
306307
* (T1, T2]
307308
* nothing since we do not have any measurement received
308309
* (T2, T3]
309310
* attributes: {name = `apple`, color = `red`}, count: `5`
310311
* attributes: {name = `apple`, color = `green`}, count: `2`
311-
* attributes: {verb = `lemon`, color = `yellow`}, count: `10`
312+
* attributes: {name = `lemon`, color = `yellow`}, count: `10`
312313

313314
Note that the start time is advanced after each export, and only the delta since
314315
last export is exported, allowing SDK to "forget" previous state.
@@ -418,9 +419,9 @@ Therefore, the actual cardinality in your metrics backend can be orders of
418419
magnitude higher than what any single OTel SDK process handles in an export
419420
cycle.
420421

421-
#### Cardinality Limit - Implications
422+
#### Cardinality Limits - Implications
422423

423-
Cardinality limits are enforced during each export interval, meaning the metrics
424+
Cardinality limits are enforced for each export interval, meaning the metrics
424425
aggregation system only allows up to the configured cardinality limit of unique
425426
attribute combinations per metric. Understanding how this works in practice is
426427
important:
@@ -471,27 +472,29 @@ important:
471472
combination is replaced with the `{"otel.metric.overflow": true}` attribute,
472473
meaning queries for any attribute in that combination will miss data points.
473474

474-
**Example**: Extending our fruit sales tracking example, imagine we set a
475-
cardinality limit of 3 and we're tracking sales with attributes for `name`,
476-
`color`, and `store_location`:
475+
#### Cardinality Limits - Example
477476

478-
During a busy sales period at time (T3, T4], we record:
479-
480-
1. 10 red apples sold at Downtown store
481-
2. 5 yellow lemons sold at Uptown store
482-
3. 8 green apples sold at Downtown store
483-
4. 3 red apples sold at Midtown store (at this point, the cardinality limit is
484-
hit, and attributes are replaced with overflow attribute.)
477+
Extending our fruit sales tracking example, imagine we set a
478+
cardinality limit of 3 and we're tracking sales with attributes for `name`,
479+
`color`, and `store_location`:
480+
481+
During a busy sales period at time (T3, T4], we record:
485482

486-
The exported metrics would be:
483+
1. 10 red apples sold at Downtown store
484+
2. 5 yellow lemons sold at Uptown store
485+
3. 8 green apples sold at Downtown store
486+
4. 3 red apples sold at Midtown store (at this point, the cardinality limit is
487+
hit, and attributes are replaced with overflow attribute.)
488+
489+
The exported metrics would be:
487490

488-
* attributes: {name = `apple`, color = `red`, store_location = `Downtown`},
491+
* attributes: {name = `apple`, color = `red`, store_location = `Downtown`},
489492
count: `10`
490-
* attributes: {name = `lemon`, color = `yellow`, store_location = `Uptown`},
493+
* attributes: {name = `lemon`, color = `yellow`, store_location = `Uptown`},
491494
count: `5`
492-
* attributes: {name = `apple`, color = `green`, store_location = `Downtown`},
495+
* attributes: {name = `apple`, color = `green`, store_location = `Downtown`},
493496
count: `8`
494-
* attributes: {`otel.metric.overflow` = `true`}, count: `3`
497+
* attributes: {`otel.metric.overflow` = `true`}, count: `3`
495498

496499
If we later query "How many red apples were sold?" the answer would be 10, not
497500
13, because the Midtown sales were folded into the overflow bucket. Similarly,

0 commit comments

Comments
 (0)