@@ -309,6 +309,10 @@ impl Meter {
309
309
}
310
310
311
311
/// creates an instrument builder for recording increasing values.
312
+ ///
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.
312
316
pub fn u64_counter (
313
317
& self ,
314
318
name : impl Into < Cow < ' static , str > > ,
@@ -317,6 +321,10 @@ impl Meter {
317
321
}
318
322
319
323
/// creates an instrument builder for recording increasing values.
324
+ ///
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.
320
328
pub fn f64_counter (
321
329
& self ,
322
330
name : impl Into < Cow < ' static , str > > ,
@@ -341,6 +349,10 @@ impl Meter {
341
349
}
342
350
343
351
/// creates an instrument builder for recording changes of a value.
352
+ ///
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.
344
356
pub fn i64_up_down_counter (
345
357
& self ,
346
358
name : impl Into < Cow < ' static , str > > ,
@@ -349,6 +361,10 @@ impl Meter {
349
361
}
350
362
351
363
/// creates an instrument builder for recording changes of a value.
364
+ ///
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.
352
368
pub fn f64_up_down_counter (
353
369
& self ,
354
370
name : impl Into < Cow < ' static , str > > ,
@@ -357,6 +373,10 @@ impl Meter {
357
373
}
358
374
359
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.
360
380
pub fn i64_observable_up_down_counter (
361
381
& self ,
362
382
name : impl Into < Cow < ' static , str > > ,
@@ -373,6 +393,10 @@ impl Meter {
373
393
}
374
394
375
395
/// creates an instrument builder for recording independent values.
396
+ ///
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.
376
400
pub fn u64_gauge (
377
401
& self ,
378
402
name : impl Into < Cow < ' static , str > > ,
@@ -381,6 +405,10 @@ impl Meter {
381
405
}
382
406
383
407
/// creates an instrument builder for recording independent values.
408
+ ///
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.
384
412
pub fn f64_gauge (
385
413
& self ,
386
414
name : impl Into < Cow < ' static , str > > ,
@@ -389,6 +417,9 @@ impl Meter {
389
417
}
390
418
391
419
/// creates an instrument builder for recording independent values.
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.
392
423
pub fn i64_gauge (
393
424
& self ,
394
425
name : impl Into < Cow < ' static , str > > ,
@@ -421,6 +452,10 @@ impl Meter {
421
452
}
422
453
423
454
/// creates an instrument builder for recording a distribution of values.
455
+ ///
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.
424
459
pub fn f64_histogram (
425
460
& self ,
426
461
name : impl Into < Cow < ' static , str > > ,
@@ -429,6 +464,10 @@ impl Meter {
429
464
}
430
465
431
466
/// creates an instrument builder for recording a distribution of values.
467
+ ///
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.
432
471
pub fn u64_histogram (
433
472
& self ,
434
473
name : impl Into < Cow < ' static , str > > ,
0 commit comments