You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* attributes: {name = `apple`, color = `green`}, count: `2`
302
301
* attributes: {verb = `lemon`, color = `yellow`}, count: `10`
303
302
304
-
Note that the start time is advanced after each export, and only the delta
305
-
since last export is exported, allowing SDK to "forget" previous state.
303
+
Note that the start time is advanced after each export, and only the delta since
304
+
last export is exported, allowing SDK to "forget" previous state.
306
305
307
306
### Pre-Aggregation
308
307
@@ -333,10 +332,15 @@ metrics backend.
333
332
334
333
Pre-aggregation offers several advantages:
335
334
336
-
1.**Reduced Data Volume**: Summarizes measurements before export, minimizing network overhead and improving efficiency.
337
-
2.**Predictable Resource Usage**: Ensures consistent resource consumption by applying [cardinality limits](#cardinality-limits) and [memory preallocation](#memory-preallocation) during SDK initialization. In other words, metrics storage/network needs remains
338
-
fixed, irrespective of growing volume or changing traffic patterns.
339
-
3.**Improved Performance**: Reduces computational load on downstream systems, enabling them to focus on analysis and storage.
335
+
1.**Reduced Data Volume**: Summarizes measurements before export, minimizing
336
+
network overhead and improving efficiency.
337
+
2.**Predictable Resource Usage**: Ensures consistent resource consumption by
338
+
applying [cardinality limits](#cardinality-limits) and [memory
339
+
preallocation](#memory-preallocation) during SDK initialization. In other words,
340
+
metrics storage/network needs remains fixed, irrespective of growing volume or
341
+
changing traffic patterns.
342
+
3.**Improved Performance**: Reduces computational load on downstream systems,
343
+
enabling them to focus on analysis and storage.
340
344
341
345
> [!NOTE] There is no ability to export raw measurement events instead of using
342
346
pre-aggregation.
@@ -346,8 +350,8 @@ pre-aggregation.
346
350
The number of unique combinations of attributes is called cardinality. Taking
347
351
the [fruit example](#example), if we know that we can only have apple/lemon as
348
352
the name, red/yellow/green as the color, then we can say the cardinality is 6.
349
-
No matter how many fruits we sell, we can always use the following
350
-
table to summarize the total number of fruits based on the name and color.
353
+
No matter how many fruits we sell, we can always use the following table to
354
+
summarize the total number of fruits based on the name and color.
351
355
352
356
| Name | Color | Count |
353
357
| ----- | ------ | ----- |
@@ -398,7 +402,8 @@ see much higher cardinality due to:
398
402
is only applicable to Delta temporality)
399
403
400
404
Therefore, the actual cardinality in your metrics backend can be orders of
401
-
magnitude higher than what any single OTel SDK process handles in an export cycle.
405
+
magnitude higher than what any single OTel SDK process handles in an export
406
+
cycle.
402
407
403
408
#### Cardinality Limit - Implications
404
409
@@ -484,8 +489,9 @@ important:
484
489
that triggered overflow.
485
490
486
491
OpenTelemetry's cardinality capping is only applied to attributes provided
487
-
when reporting measurements via the [Metrics API](#metrics-api). In other words, attributes used to create
488
-
`Meter` or `Resource` attributes are not subject to this cap.
492
+
when reporting measurements via the [Metrics API](#metrics-api). In other
493
+
words, attributes used to create `Meter` or `Resource` attributes are not
494
+
subject to this cap.
489
495
490
496
:heavy_check_mark: Use `Meter` attributes or `Resource` attributes as
491
497
appropriate, see [modelling attributes](#modelling-metric-attributes) for
@@ -494,13 +500,13 @@ important:
494
500
Resource - this is not only efficient, but reduced the cardinality capping
495
501
possibility as well.
496
502
503
+
// TODO: Document how to pick cardinality limit.
504
+
497
505
### Memory Preallocation
498
506
499
507
OpenTelemetry Rust SDK aims to avoid memory allocation on the hot code path.
500
508
When this is combined with [proper use of Metrics API](#metrics-api), heap
501
-
allocation can be avoided on the hot code path. Refer to the [metrics benchmark
502
-
results](../opentelemetry-sdk/benches/metrics_counter.rs) to learn the
503
-
benchmarks.
509
+
allocation can be avoided on the hot code path.
504
510
505
511
## Metrics Correlation
506
512
@@ -532,9 +538,8 @@ dimensions can come from different sources:
0 commit comments