Skip to content

Commit dfb2ce5

Browse files
committed
Remove redundant atexit shutdown registrations in plain.cloud
TracerProvider and MeterProvider already register their own atexit shutdown handlers via shutdown_on_exit=True. Registering again caused shutdown() to run twice and log "shutdown can only be called once".
1 parent 700894c commit dfb2ce5

1 file changed

Lines changed: 0 additions & 5 deletions

File tree

plain-cloud/plain/cloud/config.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
from __future__ import annotations
22

3-
import atexit
4-
53
from opentelemetry import metrics, trace
64
from opentelemetry.exporter.otlp.proto.http.metric_exporter import OTLPMetricExporter
75
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter
@@ -71,6 +69,3 @@ def ready(self) -> None:
7169
reader = PeriodicExportingMetricReader(metric_exporter)
7270
meter_provider = MeterProvider(metric_readers=[reader], resource=resource)
7371
metrics.set_meter_provider(meter_provider)
74-
75-
atexit.register(tracer_provider.shutdown)
76-
atexit.register(meter_provider.shutdown)

0 commit comments

Comments
 (0)