@@ -431,30 +431,30 @@ Instrument](./api.md#histogram). What if we collect measurements from an
431
431
[ Asynchronous Counter] ( ./api.md#asynchronous-counter ) ?
432
432
433
433
The following example shows the number of [ page
434
- faults] ( https://en.wikipedia.org/wiki/Page_fault ) of each thread since the
435
- thread ever started:
434
+ faults] ( https://en.wikipedia.org/wiki/Page_fault ) of each process since
435
+ it started:
436
436
437
437
* During the time range (T<sub >0</sub >, T<sub >1</sub >] :
438
- * pid = ` 1001 ` , tid = ` 1 ` , #PF = ` 50 `
439
- * pid = ` 1001 ` , tid = ` 2 ` , #PF = ` 30 `
438
+ * pid = ` 1001 ` , #PF = ` 50 `
439
+ * pid = ` 1002 ` , #PF = ` 30 `
440
440
* During the time range (T<sub >1</sub >, T<sub >2</sub >] :
441
- * pid = ` 1001 ` , tid = ` 1 ` , #PF = ` 53 `
442
- * pid = ` 1001 ` , tid = ` 2 ` , #PF = ` 38 `
441
+ * pid = ` 1001 ` , #PF = ` 53 `
442
+ * pid = ` 1002 ` , #PF = ` 38 `
443
443
* During the time range (T<sub >2</sub >, T<sub >3</sub >]
444
- * pid = ` 1001 ` , tid = ` 1 ` , #PF = ` 56 `
445
- * pid = ` 1001 ` , tid = ` 2 ` , #PF = ` 42 `
444
+ * pid = ` 1001 ` , #PF = ` 56 `
445
+ * pid = ` 1002 ` , #PF = ` 42 `
446
446
* During the time range (T<sub >3</sub >, T<sub >4</sub >] :
447
- * pid = ` 1001 ` , tid = ` 1 ` , #PF = ` 60 `
448
- * pid = ` 1001 ` , tid = ` 2 ` , #PF = ` 47 `
447
+ * pid = ` 1001 ` , #PF = ` 60 `
448
+ * pid = ` 1002 ` , #PF = ` 47 `
449
449
* During the time range (T<sub >4</sub >, T<sub >5</sub >] :
450
- * thread 1 died, thread 3 started
451
- * pid = ` 1001 ` , tid = ` 2 ` , #PF = ` 53 `
452
- * pid = ` 1001 ` , tid = ` 3 ` , #PF = ` 5 `
450
+ * process 1 died, process 3 started
451
+ * pid = ` 1002 ` , #PF = ` 53 `
452
+ * pid = ` 1003 ` , #PF = ` 5 `
453
453
* During the time range (T<sub >5</sub >, T<sub >6</sub >] :
454
- * thread 1 restarts
455
- * pid = ` 1001 ` , tid = ` 1 ` , #PF = ` 10 `
456
- * pid = ` 1001 ` , tid = ` 2 ` , #PF = ` 57 `
457
- * pid = ` 1001 ` , tid = ` 3 ` , #PF = ` 8 `
454
+ * A new process 1001 started
455
+ * pid = ` 1001 ` , #PF = ` 10 `
456
+ * pid = ` 1002 ` , #PF = ` 57 `
457
+ * pid = ` 1003 ` , #PF = ` 8 `
458
458
459
459
Note that in the following examples, Cumulative aggregation
460
460
temporality is discussed before Delta aggregation temporality because
@@ -466,27 +466,27 @@ API with specified Cumulative aggregation temporality.
466
466
If we export the metrics using ** Cumulative Temporality** :
467
467
468
468
* (T<sub >0</sub >, T<sub >1</sub >]
469
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, sum: ` 50 `
470
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, sum: ` 30 `
469
+ * attributes: {pid = ` 1001 ` }, sum: ` 50 `
470
+ * attributes: {pid = ` 1002 ` }, sum: ` 30 `
471
471
* (T<sub >0</sub >, T<sub >2</sub >]
472
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, sum: ` 53 `
473
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, sum: ` 38 `
472
+ * attributes: {pid = ` 1001 ` }, sum: ` 53 `
473
+ * attributes: {pid = ` 1002 ` }, sum: ` 38 `
474
474
* (T<sub >0</sub >, T<sub >3</sub >]
475
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, sum: ` 56 `
476
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, sum: ` 42 `
475
+ * attributes: {pid = ` 1001 ` }, sum: ` 56 `
476
+ * attributes: {pid = ` 1002 ` }, sum: ` 42 `
477
477
* (T<sub >0</sub >, T<sub >4</sub >]
478
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, sum: ` 60 `
479
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, sum: ` 47 `
478
+ * attributes: {pid = ` 1001 ` }, sum: ` 60 `
479
+ * attributes: {pid = ` 1002 ` }, sum: ` 47 `
480
480
* (T<sub >0</sub >, T<sub >5</sub >]
481
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, sum: ` 53 `
481
+ * attributes: {pid = ` 1002 ` }, sum: ` 53 `
482
482
* (T<sub >4</sub >, T<sub >5</sub >]
483
- * attributes: {pid = ` 1001 ` , tid = ` 3 ` }, sum: ` 5 `
483
+ * attributes: {pid = ` 1003 ` }, sum: ` 5 `
484
484
* (T<sub >5</sub >, T<sub >6</sub >]
485
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, sum: ` 10 `
485
+ * attributes: {pid = ` 1001 ` }, sum: ` 10 `
486
486
* (T<sub >0</sub >, T<sub >6</sub >]
487
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, sum: ` 57 `
487
+ * attributes: {pid = ` 1002 ` }, sum: ` 57 `
488
488
* (T<sub >4</sub >, T<sub >6</sub >]
489
- * attributes: {pid = ` 1001 ` , tid = ` 3 ` }, sum: ` 8 `
489
+ * attributes: {pid = ` 1003 ` }, sum: ` 8 `
490
490
491
491
The behavior in the first four periods is quite straightforward - we
492
492
just take the data being reported from the asynchronous instruments
@@ -532,24 +532,23 @@ data model.
532
532
If we export the metrics using ** Delta Temporality** :
533
533
534
534
* (T<sub >0</sub >, T<sub >1</sub >]
535
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, delta: ` 50 `
536
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, delta: ` 30 `
535
+ * attributes: {pid = ` 1002 ` }, delta: ` 30 `
537
536
* (T<sub >1</sub >, T<sub >2</sub >]
538
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, delta: ` 3 `
539
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, delta: ` 8 `
537
+ * attributes: {pid = ` 1001 ` }, delta: ` 3 `
538
+ * attributes: {pid = ` 1002 ` }, delta: ` 8 `
540
539
* (T<sub >2</sub >, T<sub >3</sub >]
541
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, delta: ` 3 `
542
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, delta: ` 4 `
540
+ * attributes: {pid = ` 1001 ` }, delta: ` 3 `
541
+ * attributes: {pid = ` 1002 ` }, delta: ` 4 `
543
542
* (T<sub >3</sub >, T<sub >4</sub >]
544
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, delta: ` 4 `
545
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, delta: ` 5 `
543
+ * attributes: {pid = ` 1001 ` }, delta: ` 4 `
544
+ * attributes: {pid = ` 1002 ` }, delta: ` 5 `
546
545
* (T<sub >4</sub >, T<sub >5</sub >]
547
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, delta: ` 6 `
548
- * attributes: {pid = ` 1001 ` , tid = ` 3 ` }, delta: ` 5 `
546
+ * attributes: {pid = ` 1002 ` }, delta: ` 6 `
547
+ * attributes: {pid = ` 1003 ` }, delta: ` 5 `
549
548
* (T<sub >5</sub >, T<sub >6</sub >]
550
- * attributes: {pid = ` 1001 ` , tid = ` 1 ` }, delta: ` 10 `
551
- * attributes: {pid = ` 1001 ` , tid = ` 2 ` }, delta: ` 4 `
552
- * attributes: {pid = ` 1001 ` , tid = ` 3 ` }, delta: ` 3 `
549
+ * attributes: {pid = ` 1001 ` }, delta: ` 10 `
550
+ * attributes: {pid = ` 1002 ` }, delta: ` 4 `
551
+ * attributes: {pid = ` 1003 ` }, delta: ` 3 `
553
552
554
553
You can see that we are performing Cumulative->Delta conversion, and it requires
555
554
us to remember the last value of ** every single permutation we've encountered so
@@ -577,29 +576,28 @@ So here are some suggestions that we encourage SDK implementers to consider:
577
576
##### Asynchronous example: attribute removal in a view
578
577
579
578
Suppose the metrics in the asynchronous example above are exported
580
- through a view configured to remove the ` tid ` attribute, leaving a
581
- single-dimensional count of page faults by ` pid ` . For each metric
582
- stream, two measurements are produced covering the same interval of
583
- time, which the SDK is expected to aggregate before producing the
584
- output.
579
+ through a view configured to remove the ` pid ` attribute, leaving a
580
+ count of page faults. For each metric stream, two measurements are produced
581
+ covering the same interval of time, which the SDK is expected to aggregate
582
+ before producing the output.
585
583
586
584
The data model specifies to use the "natural merge" function, in this
587
585
case meaning to add the current point values together because they
588
586
are ` Sum ` data points. The expected output is, still in ** Cumulative
589
587
Temporality** :
590
588
591
589
* (T<sub >0</sub >, T<sub >1</sub >]
592
- * dimensions: {pid = ` 1001 ` }, sum: ` 80 `
590
+ * dimensions: {}, sum: ` 80 `
593
591
* (T<sub >0</sub >, T<sub >2</sub >]
594
- * dimensions: {pid = ` 1001 ` }, sum: ` 91 `
592
+ * dimensions: {}, sum: ` 91 `
595
593
* (T<sub >0</sub >, T<sub >3</sub >]
596
- * dimensions: {pid = ` 1001 ` }, sum: ` 98 `
594
+ * dimensions: {}, sum: ` 98 `
597
595
* (T<sub >0</sub >, T<sub >4</sub >]
598
- * dimensions: {pid = ` 1001 ` }, sum: ` 107 `
596
+ * dimensions: {}, sum: ` 107 `
599
597
* (T<sub >0</sub >, T<sub >5</sub >]
600
- * dimensions: {pid = ` 1001 ` }, sum: ` 58 `
598
+ * dimensions: {}, sum: ` 58 `
601
599
* (T<sub >0</sub >, T<sub >6</sub >]
602
- * dimensions: {pid = ` 1001 ` }, sum: ` 75 `
600
+ * dimensions: {}, sum: ` 75 `
603
601
604
602
As discussed in the asynchronous cumulative temporality example above,
605
603
there are various treatments available for detecting resets. Even if
0 commit comments