@@ -247,27 +247,27 @@ def __init__(
247
247
if typ is Counter :
248
248
self ._instrument_class_temporality [_Counter ] = temporality
249
249
elif typ is UpDownCounter :
250
- self ._instrument_class_temporality [
251
- _UpDownCounter
252
- ] = temporality
250
+ self ._instrument_class_temporality [_UpDownCounter ] = (
251
+ temporality
252
+ )
253
253
elif typ is Histogram :
254
- self ._instrument_class_temporality [
255
- _Histogram
256
- ] = temporality
254
+ self ._instrument_class_temporality [_Histogram ] = (
255
+ temporality
256
+ )
257
257
elif typ is Gauge :
258
258
self ._instrument_class_temporality [_Gauge ] = temporality
259
259
elif typ is ObservableCounter :
260
- self ._instrument_class_temporality [
261
- _ObservableCounter
262
- ] = temporality
260
+ self ._instrument_class_temporality [_ObservableCounter ] = (
261
+ temporality
262
+ )
263
263
elif typ is ObservableUpDownCounter :
264
264
self ._instrument_class_temporality [
265
265
_ObservableUpDownCounter
266
266
] = temporality
267
267
elif typ is ObservableGauge :
268
- self ._instrument_class_temporality [
269
- _ObservableGauge
270
- ] = temporality
268
+ self ._instrument_class_temporality [_ObservableGauge ] = (
269
+ temporality
270
+ )
271
271
else :
272
272
raise Exception (f"Invalid instrument class found { typ } " )
273
273
@@ -287,27 +287,27 @@ def __init__(
287
287
if typ is Counter :
288
288
self ._instrument_class_aggregation [_Counter ] = aggregation
289
289
elif typ is UpDownCounter :
290
- self ._instrument_class_aggregation [
291
- _UpDownCounter
292
- ] = aggregation
290
+ self ._instrument_class_aggregation [_UpDownCounter ] = (
291
+ aggregation
292
+ )
293
293
elif typ is Histogram :
294
- self ._instrument_class_aggregation [
295
- _Histogram
296
- ] = aggregation
294
+ self ._instrument_class_aggregation [_Histogram ] = (
295
+ aggregation
296
+ )
297
297
elif typ is Gauge :
298
298
self ._instrument_class_aggregation [_Gauge ] = aggregation
299
299
elif typ is ObservableCounter :
300
- self ._instrument_class_aggregation [
301
- _ObservableCounter
302
- ] = aggregation
300
+ self ._instrument_class_aggregation [_ObservableCounter ] = (
301
+ aggregation
302
+ )
303
303
elif typ is ObservableUpDownCounter :
304
304
self ._instrument_class_aggregation [
305
305
_ObservableUpDownCounter
306
306
] = aggregation
307
307
elif typ is ObservableGauge :
308
- self ._instrument_class_aggregation [
309
- _ObservableGauge
310
- ] = aggregation
308
+ self ._instrument_class_aggregation [_ObservableGauge ] = (
309
+ aggregation
310
+ )
311
311
else :
312
312
raise Exception (f"Invalid instrument class found { typ } " )
313
313
@@ -398,13 +398,13 @@ def __init__(
398
398
preferred_aggregation = preferred_aggregation ,
399
399
)
400
400
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
+ )
404
404
405
405
def get_metrics_data (
406
406
self ,
407
- ) -> ( "opentelemetry.sdk.metrics.export.MetricsData" ) :
407
+ ) -> "opentelemetry.sdk.metrics.export.MetricsData" :
408
408
"""Reads and returns current metrics from the SDK"""
409
409
with self ._lock :
410
410
self .collect ()
@@ -551,9 +551,7 @@ def _shutdown():
551
551
552
552
self ._shutdown_event .set ()
553
553
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 )
557
555
self ._exporter .shutdown (timeout = (deadline_ns - time_ns ()) / 10 ** 6 )
558
556
559
557
def force_flush (self , timeout_millis : float = 10_000 ) -> bool :
0 commit comments