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
Copy file name to clipboardExpand all lines: opentelemetry/src/metrics/instruments/up_down_counter.rs
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,9 @@ use super::SyncInstrument;
6
6
7
7
/// An instrument that records increasing or decreasing values.
8
8
///
9
-
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`UpDownCounter`]s for the same instrument.
9
+
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. If a [`UpDownCounter`] needs to be shared,
10
+
/// users are recommended to clone the [`UpDownCounter`] instead of creating duplicate [`UpDownCounter`]s for the same metric. Creating
11
+
/// duplicate [`UpDownCounter`]s for the same metric could lower SDK performance.
Copy file name to clipboardExpand all lines: opentelemetry/src/metrics/meter.rs
+31-10Lines changed: 31 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -310,7 +310,9 @@ impl Meter {
310
310
311
311
/// creates an instrument builder for recording increasing values.
312
312
///
313
-
/// [`Counter`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Counter`]s for the same instrument.
313
+
/// [`Counter`] can be cloned to create multiple handles to the same instrument. If a [`Counter`] needs to be shared,
314
+
/// users are recommended to clone the [`Counter`] instead of creating duplicate [`Counter`]s for the same metric. Creating
315
+
/// duplicate [`Counter`]s for the same metric could lower SDK performance.
314
316
pubfnu64_counter(
315
317
&self,
316
318
name:implInto<Cow<'static,str>>,
@@ -320,7 +322,9 @@ impl Meter {
320
322
321
323
/// creates an instrument builder for recording increasing values.
322
324
///
323
-
/// [`Counter`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Counter`]s for the same instrument.
325
+
/// [`Counter`] can be cloned to create multiple handles to the same instrument. If a [`Counter`] needs to be shared,
326
+
/// users are recommended to clone the [`Counter`] instead of creating duplicate [`Counter`]s for the same metric. Creating
327
+
/// duplicate [`Counter`]s for the same metric could lower SDK performance.
324
328
pubfnf64_counter(
325
329
&self,
326
330
name:implInto<Cow<'static,str>>,
@@ -346,7 +350,9 @@ impl Meter {
346
350
347
351
/// creates an instrument builder for recording changes of a value.
348
352
///
349
-
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`UpDownCounter`]s for the same instrument.
353
+
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. If a [`UpDownCounter`] needs to be shared,
354
+
/// users are recommended to clone the [`UpDownCounter`] instead of creating duplicate [`UpDownCounter`]s for the same metric. Creating
355
+
/// duplicate [`UpDownCounter`]s for the same metric could lower SDK performance.
350
356
pubfni64_up_down_counter(
351
357
&self,
352
358
name:implInto<Cow<'static,str>>,
@@ -356,7 +362,9 @@ impl Meter {
356
362
357
363
/// creates an instrument builder for recording changes of a value.
358
364
///
359
-
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`UpDownCounter`]s for the same instrument.
365
+
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. If a [`UpDownCounter`] needs to be shared,
366
+
/// users are recommended to clone the [`UpDownCounter`] instead of creating duplicate [`UpDownCounter`]s for the same metric. Creating
367
+
/// duplicate [`UpDownCounter`]s for the same metric could lower SDK performance.
360
368
pubfnf64_up_down_counter(
361
369
&self,
362
370
name:implInto<Cow<'static,str>>,
@@ -365,6 +373,10 @@ impl Meter {
365
373
}
366
374
367
375
/// creates an instrument builder for recording changes of a value via callback.
376
+
///
377
+
/// [`UpDownCounter`] can be cloned to create multiple handles to the same instrument. If a [`UpDownCounter`] needs to be shared,
378
+
/// users are recommended to clone the [`UpDownCounter`] instead of creating duplicate [`UpDownCounter`]s for the same metric. Creating
379
+
/// duplicate [`UpDownCounter`]s for the same metric could lower SDK performance.
368
380
pubfni64_observable_up_down_counter(
369
381
&self,
370
382
name:implInto<Cow<'static,str>>,
@@ -382,7 +394,9 @@ impl Meter {
382
394
383
395
/// creates an instrument builder for recording independent values.
384
396
///
385
-
/// [`Gauge`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Gauge`]s for the same instrument.
397
+
/// [`Gauge`] can be cloned to create multiple handles to the same instrument. If a [`Gauge`] needs to be shared,
398
+
/// users are recommended to clone the [`Gauge`] instead of creating duplicate [`Gauge`]s for the same metric. Creating
399
+
/// duplicate [`Gauge`]s for the same metric could lower SDK performance.
386
400
pubfnu64_gauge(
387
401
&self,
388
402
name:implInto<Cow<'static,str>>,
@@ -392,7 +406,9 @@ impl Meter {
392
406
393
407
/// creates an instrument builder for recording independent values.
394
408
///
395
-
/// [`Gauge`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Gauge`]s for the same instrument.
409
+
/// [`Gauge`] can be cloned to create multiple handles to the same instrument. If a [`Gauge`] needs to be shared,
410
+
/// users are recommended to clone the [`Gauge`] instead of creating duplicate [`Gauge`]s for the same metric. Creating
411
+
/// duplicate [`Gauge`]s for the same metric could lower SDK performance.
396
412
pubfnf64_gauge(
397
413
&self,
398
414
name:implInto<Cow<'static,str>>,
@@ -401,8 +417,9 @@ impl Meter {
401
417
}
402
418
403
419
/// creates an instrument builder for recording independent values.
404
-
///
405
-
/// /// [`Gauge`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Gauge`]s for the same instrument.
420
+
/// [`Gauge`] can be cloned to create multiple handles to the same instrument. If a [`Gauge`] needs to be shared,
421
+
/// users are recommended to clone the [`Gauge`] instead of creating duplicate [`Gauge`]s for the same metric. Creating
422
+
/// duplicate [`Gauge`]s for the same metric could lower SDK performance.
406
423
pubfni64_gauge(
407
424
&self,
408
425
name:implInto<Cow<'static,str>>,
@@ -436,7 +453,9 @@ impl Meter {
436
453
437
454
/// creates an instrument builder for recording a distribution of values.
438
455
///
439
-
/// [`Histogram`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Histogram`]s for the same instrument.
456
+
/// [`Histogram`] can be cloned to create multiple handles to the same instrument. If a [`Histogram`] needs to be shared,
457
+
/// users are recommended to clone the [`Histogram`] instead of creating duplicate [`Histogram`]s for the same metric. Creating
458
+
/// duplicate [`Histogram`]s for the same metric could lower SDK performance.
440
459
pubfnf64_histogram(
441
460
&self,
442
461
name:implInto<Cow<'static,str>>,
@@ -446,7 +465,9 @@ impl Meter {
446
465
447
466
/// creates an instrument builder for recording a distribution of values.
448
467
///
449
-
/// [`Histogram`] can be cloned to create multiple handles to the same instrument. Avoid creating duplicate [`Histogram`]s for the same instrument.
468
+
/// [`Histogram`] can be cloned to create multiple handles to the same instrument. If a [`Histogram`] needs to be shared,
469
+
/// users are recommended to clone the [`Histogram`] instead of creating duplicate [`Histogram`]s for the same metric. Creating
470
+
/// duplicate [`Histogram`]s for the same metric could lower SDK performance.
0 commit comments