@@ -247,27 +247,27 @@ def __init__(
247247 if typ is Counter :
248248 self ._instrument_class_temporality [_Counter ] = temporality
249249 elif typ is UpDownCounter :
250- self ._instrument_class_temporality [
251- _UpDownCounter
252- ] = temporality
250+ self ._instrument_class_temporality [_UpDownCounter ] = (
251+ temporality
252+ )
253253 elif typ is Histogram :
254- self ._instrument_class_temporality [
255- _Histogram
256- ] = temporality
254+ self ._instrument_class_temporality [_Histogram ] = (
255+ temporality
256+ )
257257 elif typ is Gauge :
258258 self ._instrument_class_temporality [_Gauge ] = temporality
259259 elif typ is ObservableCounter :
260- self ._instrument_class_temporality [
261- _ObservableCounter
262- ] = temporality
260+ self ._instrument_class_temporality [_ObservableCounter ] = (
261+ temporality
262+ )
263263 elif typ is ObservableUpDownCounter :
264264 self ._instrument_class_temporality [
265265 _ObservableUpDownCounter
266266 ] = temporality
267267 elif typ is ObservableGauge :
268- self ._instrument_class_temporality [
269- _ObservableGauge
270- ] = temporality
268+ self ._instrument_class_temporality [_ObservableGauge ] = (
269+ temporality
270+ )
271271 else :
272272 raise Exception (f"Invalid instrument class found { typ } " )
273273
@@ -287,27 +287,27 @@ def __init__(
287287 if typ is Counter :
288288 self ._instrument_class_aggregation [_Counter ] = aggregation
289289 elif typ is UpDownCounter :
290- self ._instrument_class_aggregation [
291- _UpDownCounter
292- ] = aggregation
290+ self ._instrument_class_aggregation [_UpDownCounter ] = (
291+ aggregation
292+ )
293293 elif typ is Histogram :
294- self ._instrument_class_aggregation [
295- _Histogram
296- ] = aggregation
294+ self ._instrument_class_aggregation [_Histogram ] = (
295+ aggregation
296+ )
297297 elif typ is Gauge :
298298 self ._instrument_class_aggregation [_Gauge ] = aggregation
299299 elif typ is ObservableCounter :
300- self ._instrument_class_aggregation [
301- _ObservableCounter
302- ] = aggregation
300+ self ._instrument_class_aggregation [_ObservableCounter ] = (
301+ aggregation
302+ )
303303 elif typ is ObservableUpDownCounter :
304304 self ._instrument_class_aggregation [
305305 _ObservableUpDownCounter
306306 ] = aggregation
307307 elif typ is ObservableGauge :
308- self ._instrument_class_aggregation [
309- _ObservableGauge
310- ] = aggregation
308+ self ._instrument_class_aggregation [_ObservableGauge ] = (
309+ aggregation
310+ )
311311 else :
312312 raise Exception (f"Invalid instrument class found { typ } " )
313313
@@ -398,13 +398,13 @@ def __init__(
398398 preferred_aggregation = preferred_aggregation ,
399399 )
400400 self ._lock = RLock ()
401- self ._metrics_data : (
402- "opentelemetry.sdk.metrics.export.MetricsData"
403- ) = None
401+ self ._metrics_data : "opentelemetry.sdk.metrics.export.MetricsData" = (
402+ None
403+ )
404404
405405 def get_metrics_data (
406406 self ,
407- ) -> ( "opentelemetry.sdk.metrics.export.MetricsData" ) :
407+ ) -> "opentelemetry.sdk.metrics.export.MetricsData" :
408408 """Reads and returns current metrics from the SDK"""
409409 with self ._lock :
410410 self .collect ()
@@ -551,9 +551,7 @@ def _shutdown():
551551
552552 self ._shutdown_event .set ()
553553 if self ._daemon_thread :
554- self ._daemon_thread .join (
555- timeout = (deadline_ns - time_ns ()) / 10 ** 9
556- )
554+ self ._daemon_thread .join (timeout = (deadline_ns - time_ns ()) / 10 ** 9 )
557555 self ._exporter .shutdown (timeout = (deadline_ns - time_ns ()) / 10 ** 6 )
558556
559557 def force_flush (self , timeout_millis : float = 10_000 ) -> bool :
0 commit comments