File tree 3 files changed +18
-6
lines changed
3 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,5 @@ def init(
67
67
)
68
68
69
69
@staticmethod
70
- def flush ():
71
- if getattr (TracerManager , "__tracer_wrapper" , None ):
72
- TracerManager .__tracer_wrapper .flush ()
70
+ def flush () -> bool :
71
+ return TracerManager .__tracer_wrapper .flush ()
Original file line number Diff line number Diff line change @@ -236,8 +236,13 @@ def clear(cls):
236
236
cls .__span_id_to_path = {}
237
237
cls .__span_id_lists = {}
238
238
239
- def flush (self ):
239
+ def shutdown (self ):
240
240
self .__spans_processor .force_flush ()
241
+ self .__spans_processor .shutdown ()
242
+ self .__tracer_provider .shutdown ()
243
+
244
+ def flush (self ):
245
+ return self .__spans_processor .force_flush ()
241
246
242
247
def get_tracer (self ):
243
248
return self .__tracer_provider .get_tracer (TRACER_NAME )
Original file line number Diff line number Diff line change @@ -639,8 +639,16 @@ def deserialize_span_context(
639
639
return LaminarSpanContext .deserialize (span_context )
640
640
641
641
@classmethod
642
- def flush (cls ):
643
- TracerManager .flush ()
642
+ def flush (cls ) -> bool :
643
+ """Flush the internal tracer.
644
+
645
+ Returns:
646
+ bool: True if the tracer was flushed, False otherwise
647
+ (e.g. no tracer or timeout).
648
+ """
649
+ if not cls .is_initialized ():
650
+ return False
651
+ return TracerManager .flush ()
644
652
645
653
@classmethod
646
654
def shutdown (cls ):
You can’t perform that action at this time.
0 commit comments