77
77
from opentelemetry .util ._providers import _load_provider
78
78
from opentelemetry .util .types import (
79
79
Attributes ,
80
+ MetricsCommonAdvisory ,
80
81
MetricsHistogramAdvisory ,
81
82
MetricsInstrumentAdvisory ,
82
83
)
@@ -284,7 +285,7 @@ def _log_instrument_registration_conflict(
284
285
unit : str ,
285
286
description : str ,
286
287
status : _InstrumentRegistrationStatus ,
287
- ):
288
+ ) -> None :
288
289
_logger .warning (
289
290
"An instrument with name %s, type %s, unit %s and "
290
291
"description %s has been created already with a "
@@ -302,7 +303,7 @@ def create_counter(
302
303
name : str ,
303
304
unit : str = "" ,
304
305
description : str = "" ,
305
- advisory : None = None ,
306
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
306
307
) -> Counter :
307
308
"""Creates a `Counter` instrument
308
309
@@ -319,7 +320,7 @@ def create_up_down_counter(
319
320
name : str ,
320
321
unit : str = "" ,
321
322
description : str = "" ,
322
- advisory : None = None ,
323
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
323
324
) -> UpDownCounter :
324
325
"""Creates an `UpDownCounter` instrument
325
326
@@ -337,7 +338,7 @@ def create_observable_counter(
337
338
callbacks : Optional [Sequence [CallbackT ]] = None ,
338
339
unit : str = "" ,
339
340
description : str = "" ,
340
- advisory : None = None ,
341
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
341
342
) -> ObservableCounter :
342
343
"""Creates an `ObservableCounter` instrument
343
344
@@ -450,7 +451,7 @@ def create_gauge( # type: ignore # pylint: disable=no-self-use
450
451
name : str ,
451
452
unit : str = "" ,
452
453
description : str = "" ,
453
- advisory : None = None ,
454
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
454
455
) -> Gauge :
455
456
"""Creates a ``Gauge`` instrument
456
457
@@ -469,7 +470,7 @@ def create_observable_gauge(
469
470
callbacks : Optional [Sequence [CallbackT ]] = None ,
470
471
unit : str = "" ,
471
472
description : str = "" ,
472
- advisory : None = None ,
473
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
473
474
) -> ObservableGauge :
474
475
"""Creates an `ObservableGauge` instrument
475
476
@@ -490,7 +491,7 @@ def create_observable_up_down_counter(
490
491
callbacks : Optional [Sequence [CallbackT ]] = None ,
491
492
unit : str = "" ,
492
493
description : str = "" ,
493
- advisory : None = None ,
494
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
494
495
) -> ObservableUpDownCounter :
495
496
"""Creates an `ObservableUpDownCounter` instrument
496
497
@@ -539,7 +540,7 @@ def create_counter(
539
540
name : str ,
540
541
unit : str = "" ,
541
542
description : str = "" ,
542
- advisory : None = None ,
543
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
543
544
) -> Counter :
544
545
with self ._lock :
545
546
if self ._real_meter :
@@ -553,7 +554,7 @@ def create_up_down_counter(
553
554
name : str ,
554
555
unit : str = "" ,
555
556
description : str = "" ,
556
- advisory : None = None ,
557
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
557
558
) -> UpDownCounter :
558
559
with self ._lock :
559
560
if self ._real_meter :
@@ -570,7 +571,7 @@ def create_observable_counter(
570
571
callbacks : Optional [Sequence [CallbackT ]] = None ,
571
572
unit : str = "" ,
572
573
description : str = "" ,
573
- advisory : None = None ,
574
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
574
575
) -> ObservableCounter :
575
576
with self ._lock :
576
577
if self ._real_meter :
@@ -604,7 +605,7 @@ def create_gauge(
604
605
name : str ,
605
606
unit : str = "" ,
606
607
description : str = "" ,
607
- advisory : None = None ,
608
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
608
609
) -> Gauge :
609
610
with self ._lock :
610
611
if self ._real_meter :
@@ -619,7 +620,7 @@ def create_observable_gauge(
619
620
callbacks : Optional [Sequence [CallbackT ]] = None ,
620
621
unit : str = "" ,
621
622
description : str = "" ,
622
- advisory : None = None ,
623
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
623
624
) -> ObservableGauge :
624
625
with self ._lock :
625
626
if self ._real_meter :
@@ -638,7 +639,7 @@ def create_observable_up_down_counter(
638
639
callbacks : Optional [Sequence [CallbackT ]] = None ,
639
640
unit : str = "" ,
640
641
description : str = "" ,
641
- advisory : None = None ,
642
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
642
643
) -> ObservableUpDownCounter :
643
644
with self ._lock :
644
645
if self ._real_meter :
@@ -666,7 +667,7 @@ def create_counter(
666
667
name : str ,
667
668
unit : str = "" ,
668
669
description : str = "" ,
669
- advisory : None = None ,
670
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
670
671
) -> Counter :
671
672
"""Returns a no-op Counter."""
672
673
status = self ._register_instrument (
@@ -688,7 +689,7 @@ def create_gauge(
688
689
name : str ,
689
690
unit : str = "" ,
690
691
description : str = "" ,
691
- advisory : None = None ,
692
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
692
693
) -> Gauge :
693
694
"""Returns a no-op Gauge."""
694
695
status = self ._register_instrument (
@@ -709,7 +710,7 @@ def create_up_down_counter(
709
710
name : str ,
710
711
unit : str = "" ,
711
712
description : str = "" ,
712
- advisory : None = None ,
713
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
713
714
) -> UpDownCounter :
714
715
"""Returns a no-op UpDownCounter."""
715
716
status = self ._register_instrument (
@@ -731,7 +732,7 @@ def create_observable_counter(
731
732
callbacks : Optional [Sequence [CallbackT ]] = None ,
732
733
unit : str = "" ,
733
734
description : str = "" ,
734
- advisory : None = None ,
735
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
735
736
) -> ObservableCounter :
736
737
"""Returns a no-op ObservableCounter."""
737
738
status = self ._register_instrument (
@@ -781,7 +782,7 @@ def create_observable_gauge(
781
782
callbacks : Optional [Sequence [CallbackT ]] = None ,
782
783
unit : str = "" ,
783
784
description : str = "" ,
784
- advisory : None = None ,
785
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
785
786
) -> ObservableGauge :
786
787
"""Returns a no-op ObservableGauge."""
787
788
status = self ._register_instrument (
@@ -808,7 +809,7 @@ def create_observable_up_down_counter(
808
809
callbacks : Optional [Sequence [CallbackT ]] = None ,
809
810
unit : str = "" ,
810
811
description : str = "" ,
811
- advisory : None = None ,
812
+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
812
813
) -> ObservableUpDownCounter :
813
814
"""Returns a no-op ObservableUpDownCounter."""
814
815
status = self ._register_instrument (
0 commit comments