@@ -224,9 +224,35 @@ instrument. It MUST be treated as an opaque string from the API and SDK.
224
224
* It MUST support at least 1023 characters. Individual language clients can
225
225
decide if they want to support more.
226
226
227
+ Instruments can be categorized based on whether they are synchronous or
228
+ asynchronous:
229
+
230
+ <a name =" synchronous-instrument " ></a >
231
+
232
+ * Synchronous instruments (e.g. [ Counter] ( #counter ) ) are meant to be invoked
233
+ inline with application/business processing logic. For example, an HTTP client
234
+ could use a Counter to record the number of bytes it has received.
235
+ [ Measurements] ( #measurement ) recorded by synchronous instruments can be
236
+ associated with the [ Context] ( ../context/context.md ) .
237
+
238
+ <a name =" asynchronous-instrument " ></a >
239
+
240
+ * Asynchronous instruments (e.g. [ Asynchronous Gauge] ( #asynchronous-gauge ) ) give
241
+ the user a way to register callback function, and the callback function will
242
+ only be invoked upon collection. For example, a piece of embedded software
243
+ could use an asynchronous gauge to collect the temperature from a sensor every
244
+ 15 seconds, which means the callback function will only be invoked every 15
245
+ seconds. [ Measurements] ( #measurement ) recorded by asynchronous instruments
246
+ cannot be associated with the [ Context] ( ../context/context.md ) .
247
+
248
+ Please note that the term _ synchronous_ and _ asynchronous_ have nothing to do
249
+ with the [ asynchronous
250
+ pattern] ( https://en.wikipedia.org/wiki/Asynchronous_method_invocation ) .
251
+
227
252
### Counter
228
253
229
- ` Counter ` is a synchronous Instrument which supports non-negative increments.
254
+ ` Counter ` is a [ synchronous Instrument] ( #synchronous-instrument ) which supports
255
+ non-negative increments.
230
256
231
257
Example uses for ` Counter ` :
232
258
@@ -317,9 +343,9 @@ counterPowerUsed.Add(200, new PowerConsumption { customer = "Jerry" }, ("is_gree
317
343
318
344
### Asynchronous Counter
319
345
320
- Asynchronous Counter is an asynchronous Instrument which reports
321
- [ monotonically] ( https://wikipedia.org/wiki/Monotonic_function ) increasing
322
- value(s) when the instrument is being observed.
346
+ Asynchronous Counter is an [ asynchronous Instrument] ( #asynchronous-instrument )
347
+ which reports [ monotonically] ( https://wikipedia.org/wiki/Monotonic_function )
348
+ increasing value(s) when the instrument is being observed.
323
349
324
350
Example uses for Asynchronous Counter:
325
351
@@ -441,9 +467,9 @@ operation is provided by the `callback`, which is registered during the
441
467
442
468
### Histogram
443
469
444
- ` Histogram ` is a synchronous Instrument which can be used to report arbitrary
445
- values that are likely to be statistically meaningful. It is intended for
446
- statistics such as histograms, summaries, and percentile.
470
+ ` Histogram ` is a [ synchronous Instrument] ( #synchronous-instrument ) which can be
471
+ used to report arbitrary values that are likely to be statistically meaningful.
472
+ It is intended for statistics such as histograms, summaries, and percentile.
447
473
448
474
Example uses for ` Histogram ` :
449
475
@@ -525,10 +551,10 @@ httpServerDuration.Record(100, new HttpRequestAttributes { method = "GET", schem
525
551
526
552
### Asynchronous Gauge
527
553
528
- Asynchronous Gauge is an asynchronous Instrument which reports non-additive
529
- value(s) (_ e.g. the room temperature - it makes no sense to report the
530
- temperature value from multiple rooms and sum them up_ ) when the instrument is
531
- being observed.
554
+ Asynchronous Gauge is an [ asynchronous Instrument] ( #asynchronous-instrument )
555
+ which reports non-additive value(s) (_ e.g. the room temperature - it makes no
556
+ sense to report the temperature value from multiple rooms and sum them up_ ) when
557
+ the instrument is being observed.
532
558
533
559
Note: if the values are additive (_ e.g. the process heap size - it makes sense
534
560
to report the heap size from multiple processes and sum them up, so we get the
@@ -652,8 +678,8 @@ operation is provided by the `callback`, which is registered during the
652
678
653
679
### UpDownCounter
654
680
655
- ` UpDownCounter ` is a synchronous Instrument which supports increments and
656
- decrements.
681
+ ` UpDownCounter ` is a [ synchronous Instrument] ( #synchronous-instrument ) which
682
+ supports increments and decrements.
657
683
658
684
Note: if the value grows
659
685
[ monotonically] ( https://wikipedia.org/wiki/Monotonic_function ) , use
@@ -790,10 +816,11 @@ customersInStore.Add(-1, new Account { Type = "residential" });
790
816
791
817
### Asynchronous UpDownCounter
792
818
793
- Asynchronous UpDownCounter is an asynchronous Instrument which reports additive
794
- value(s) (_ e.g. the process heap size - it makes sense to report the heap size
795
- from multiple processes and sum them up, so we get the total heap usage_ ) when
796
- the instrument is being observed.
819
+ Asynchronous UpDownCounter is an [ asynchronous
820
+ Instrument] ( #asynchronous-instrument ) which reports additive value(s) (_ e.g. the
821
+ process heap size - it makes sense to report the heap size from multiple
822
+ processes and sum them up, so we get the total heap usage_ ) when the instrument
823
+ is being observed.
797
824
798
825
Note: if the value grows
799
826
[ monotonically] ( https://wikipedia.org/wiki/Monotonic_function ) , use
0 commit comments