@@ -202,7 +202,9 @@ def __init__(
202202 self ._name = name
203203 self ._version = version
204204 self ._schema_url = schema_url
205- self ._instrument_ids : Dict [str , str ] = {}
205+ self ._instrument_ids : Dict [
206+ str , Optional [MetricsInstrumentAdvisory ]
207+ ] = {}
206208 self ._instrument_ids_lock = Lock ()
207209
208210 @property
@@ -277,7 +279,7 @@ def create_counter(
277279 name : str ,
278280 unit : str = "" ,
279281 description : str = "" ,
280- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
282+ advisory : None = None ,
281283 ) -> Counter :
282284 """Creates a `Counter` instrument
283285
@@ -294,7 +296,7 @@ def create_up_down_counter(
294296 name : str ,
295297 unit : str = "" ,
296298 description : str = "" ,
297- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
299+ advisory : None = None ,
298300 ) -> UpDownCounter :
299301 """Creates an `UpDownCounter` instrument
300302
@@ -312,7 +314,7 @@ def create_observable_counter(
312314 callbacks : Optional [Sequence [CallbackT ]] = None ,
313315 unit : str = "" ,
314316 description : str = "" ,
315- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
317+ advisory : None = None ,
316318 ) -> ObservableCounter :
317319 """Creates an `ObservableCounter` instrument
318320
@@ -425,7 +427,7 @@ def create_gauge( # type: ignore # pylint: disable=no-self-use
425427 name : str ,
426428 unit : str = "" ,
427429 description : str = "" ,
428- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
430+ advisory : None = None ,
429431 ) -> Gauge :
430432 """Creates a ``Gauge`` instrument
431433
@@ -444,7 +446,7 @@ def create_observable_gauge(
444446 callbacks : Optional [Sequence [CallbackT ]] = None ,
445447 unit : str = "" ,
446448 description : str = "" ,
447- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
449+ advisory : None = None ,
448450 ) -> ObservableGauge :
449451 """Creates an `ObservableGauge` instrument
450452
@@ -465,7 +467,7 @@ def create_observable_up_down_counter(
465467 callbacks : Optional [Sequence [CallbackT ]] = None ,
466468 unit : str = "" ,
467469 description : str = "" ,
468- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
470+ advisory : None = None ,
469471 ) -> ObservableUpDownCounter :
470472 """Creates an `ObservableUpDownCounter` instrument
471473
@@ -514,7 +516,7 @@ def create_counter(
514516 name : str ,
515517 unit : str = "" ,
516518 description : str = "" ,
517- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
519+ advisory : None = None ,
518520 ) -> Counter :
519521 with self ._lock :
520522 if self ._real_meter :
@@ -528,7 +530,7 @@ def create_up_down_counter(
528530 name : str ,
529531 unit : str = "" ,
530532 description : str = "" ,
531- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
533+ advisory : None = None ,
532534 ) -> UpDownCounter :
533535 with self ._lock :
534536 if self ._real_meter :
@@ -545,7 +547,7 @@ def create_observable_counter(
545547 callbacks : Optional [Sequence [CallbackT ]] = None ,
546548 unit : str = "" ,
547549 description : str = "" ,
548- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
550+ advisory : None = None ,
549551 ) -> ObservableCounter :
550552 with self ._lock :
551553 if self ._real_meter :
@@ -579,7 +581,7 @@ def create_gauge(
579581 name : str ,
580582 unit : str = "" ,
581583 description : str = "" ,
582- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
584+ advisory : None = None ,
583585 ) -> Gauge :
584586 with self ._lock :
585587 if self ._real_meter :
@@ -594,7 +596,7 @@ def create_observable_gauge(
594596 callbacks : Optional [Sequence [CallbackT ]] = None ,
595597 unit : str = "" ,
596598 description : str = "" ,
597- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
599+ advisory : None = None ,
598600 ) -> ObservableGauge :
599601 with self ._lock :
600602 if self ._real_meter :
@@ -613,7 +615,7 @@ def create_observable_up_down_counter(
613615 callbacks : Optional [Sequence [CallbackT ]] = None ,
614616 unit : str = "" ,
615617 description : str = "" ,
616- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
618+ advisory : None = None ,
617619 ) -> ObservableUpDownCounter :
618620 with self ._lock :
619621 if self ._real_meter :
@@ -641,7 +643,7 @@ def create_counter(
641643 name : str ,
642644 unit : str = "" ,
643645 description : str = "" ,
644- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
646+ advisory : None = None ,
645647 ) -> Counter :
646648 """Returns a no-op Counter."""
647649 _ , status = self ._register_instrument (
@@ -665,7 +667,7 @@ def create_gauge(
665667 name : str ,
666668 unit : str = "" ,
667669 description : str = "" ,
668- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
670+ advisory : None = None ,
669671 ) -> Gauge :
670672 """Returns a no-op Gauge."""
671673 _ , status = self ._register_instrument (
@@ -689,7 +691,7 @@ def create_up_down_counter(
689691 name : str ,
690692 unit : str = "" ,
691693 description : str = "" ,
692- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
694+ advisory : None = None ,
693695 ) -> UpDownCounter :
694696 """Returns a no-op UpDownCounter."""
695697 _ , status = self ._register_instrument (
@@ -714,7 +716,7 @@ def create_observable_counter(
714716 callbacks : Optional [Sequence [CallbackT ]] = None ,
715717 unit : str = "" ,
716718 description : str = "" ,
717- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
719+ advisory : None = None ,
718720 ) -> ObservableCounter :
719721 """Returns a no-op ObservableCounter."""
720722 _ , status = self ._register_instrument (
@@ -770,7 +772,7 @@ def create_observable_gauge(
770772 callbacks : Optional [Sequence [CallbackT ]] = None ,
771773 unit : str = "" ,
772774 description : str = "" ,
773- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
775+ advisory : None = None ,
774776 ) -> ObservableGauge :
775777 """Returns a no-op ObservableGauge."""
776778 _ , status = self ._register_instrument (
@@ -800,7 +802,7 @@ def create_observable_up_down_counter(
800802 callbacks : Optional [Sequence [CallbackT ]] = None ,
801803 unit : str = "" ,
802804 description : str = "" ,
803- advisory : Optional [ MetricsInstrumentAdvisory ] = None ,
805+ advisory : None = None ,
804806 ) -> ObservableUpDownCounter :
805807 """Returns a no-op ObservableUpDownCounter."""
806808 _ , status = self ._register_instrument (
0 commit comments