7777from opentelemetry .util ._providers import _load_provider
7878from opentelemetry .util .types import (
7979 Attributes ,
80+ MetricsCommonAdvisory ,
8081 MetricsHistogramAdvisory ,
8182 MetricsInstrumentAdvisory ,
8283)
@@ -284,7 +285,7 @@ def _log_instrument_registration_conflict(
284285 unit : str ,
285286 description : str ,
286287 status : _InstrumentRegistrationStatus ,
287- ):
288+ ) -> None :
288289 _logger .warning (
289290 "An instrument with name %s, type %s, unit %s and "
290291 "description %s has been created already with a "
@@ -302,7 +303,7 @@ def create_counter(
302303 name : str ,
303304 unit : str = "" ,
304305 description : str = "" ,
305- advisory : None = None ,
306+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
306307 ) -> Counter :
307308 """Creates a `Counter` instrument
308309
@@ -319,7 +320,7 @@ def create_up_down_counter(
319320 name : str ,
320321 unit : str = "" ,
321322 description : str = "" ,
322- advisory : None = None ,
323+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
323324 ) -> UpDownCounter :
324325 """Creates an `UpDownCounter` instrument
325326
@@ -337,7 +338,7 @@ def create_observable_counter(
337338 callbacks : Optional [Sequence [CallbackT ]] = None ,
338339 unit : str = "" ,
339340 description : str = "" ,
340- advisory : None = None ,
341+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
341342 ) -> ObservableCounter :
342343 """Creates an `ObservableCounter` instrument
343344
@@ -450,7 +451,7 @@ def create_gauge( # type: ignore # pylint: disable=no-self-use
450451 name : str ,
451452 unit : str = "" ,
452453 description : str = "" ,
453- advisory : None = None ,
454+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
454455 ) -> Gauge :
455456 """Creates a ``Gauge`` instrument
456457
@@ -469,7 +470,7 @@ def create_observable_gauge(
469470 callbacks : Optional [Sequence [CallbackT ]] = None ,
470471 unit : str = "" ,
471472 description : str = "" ,
472- advisory : None = None ,
473+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
473474 ) -> ObservableGauge :
474475 """Creates an `ObservableGauge` instrument
475476
@@ -490,7 +491,7 @@ def create_observable_up_down_counter(
490491 callbacks : Optional [Sequence [CallbackT ]] = None ,
491492 unit : str = "" ,
492493 description : str = "" ,
493- advisory : None = None ,
494+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
494495 ) -> ObservableUpDownCounter :
495496 """Creates an `ObservableUpDownCounter` instrument
496497
@@ -539,7 +540,7 @@ def create_counter(
539540 name : str ,
540541 unit : str = "" ,
541542 description : str = "" ,
542- advisory : None = None ,
543+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
543544 ) -> Counter :
544545 with self ._lock :
545546 if self ._real_meter :
@@ -553,7 +554,7 @@ def create_up_down_counter(
553554 name : str ,
554555 unit : str = "" ,
555556 description : str = "" ,
556- advisory : None = None ,
557+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
557558 ) -> UpDownCounter :
558559 with self ._lock :
559560 if self ._real_meter :
@@ -570,7 +571,7 @@ def create_observable_counter(
570571 callbacks : Optional [Sequence [CallbackT ]] = None ,
571572 unit : str = "" ,
572573 description : str = "" ,
573- advisory : None = None ,
574+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
574575 ) -> ObservableCounter :
575576 with self ._lock :
576577 if self ._real_meter :
@@ -604,7 +605,7 @@ def create_gauge(
604605 name : str ,
605606 unit : str = "" ,
606607 description : str = "" ,
607- advisory : None = None ,
608+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
608609 ) -> Gauge :
609610 with self ._lock :
610611 if self ._real_meter :
@@ -619,7 +620,7 @@ def create_observable_gauge(
619620 callbacks : Optional [Sequence [CallbackT ]] = None ,
620621 unit : str = "" ,
621622 description : str = "" ,
622- advisory : None = None ,
623+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
623624 ) -> ObservableGauge :
624625 with self ._lock :
625626 if self ._real_meter :
@@ -638,7 +639,7 @@ def create_observable_up_down_counter(
638639 callbacks : Optional [Sequence [CallbackT ]] = None ,
639640 unit : str = "" ,
640641 description : str = "" ,
641- advisory : None = None ,
642+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
642643 ) -> ObservableUpDownCounter :
643644 with self ._lock :
644645 if self ._real_meter :
@@ -666,7 +667,7 @@ def create_counter(
666667 name : str ,
667668 unit : str = "" ,
668669 description : str = "" ,
669- advisory : None = None ,
670+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
670671 ) -> Counter :
671672 """Returns a no-op Counter."""
672673 status = self ._register_instrument (
@@ -688,7 +689,7 @@ def create_gauge(
688689 name : str ,
689690 unit : str = "" ,
690691 description : str = "" ,
691- advisory : None = None ,
692+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
692693 ) -> Gauge :
693694 """Returns a no-op Gauge."""
694695 status = self ._register_instrument (
@@ -709,7 +710,7 @@ def create_up_down_counter(
709710 name : str ,
710711 unit : str = "" ,
711712 description : str = "" ,
712- advisory : None = None ,
713+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
713714 ) -> UpDownCounter :
714715 """Returns a no-op UpDownCounter."""
715716 status = self ._register_instrument (
@@ -731,7 +732,7 @@ def create_observable_counter(
731732 callbacks : Optional [Sequence [CallbackT ]] = None ,
732733 unit : str = "" ,
733734 description : str = "" ,
734- advisory : None = None ,
735+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
735736 ) -> ObservableCounter :
736737 """Returns a no-op ObservableCounter."""
737738 status = self ._register_instrument (
@@ -781,7 +782,7 @@ def create_observable_gauge(
781782 callbacks : Optional [Sequence [CallbackT ]] = None ,
782783 unit : str = "" ,
783784 description : str = "" ,
784- advisory : None = None ,
785+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
785786 ) -> ObservableGauge :
786787 """Returns a no-op ObservableGauge."""
787788 status = self ._register_instrument (
@@ -808,7 +809,7 @@ def create_observable_up_down_counter(
808809 callbacks : Optional [Sequence [CallbackT ]] = None ,
809810 unit : str = "" ,
810811 description : str = "" ,
811- advisory : None = None ,
812+ advisory : Optional [ MetricsCommonAdvisory ] = None ,
812813 ) -> ObservableUpDownCounter :
813814 """Returns a no-op ObservableUpDownCounter."""
814815 status = self ._register_instrument (
0 commit comments