Skip to content

Commit

Permalink
feat(session): force flush pending spans on session end
Browse files Browse the repository at this point in the history
  • Loading branch information
teocns committed Nov 26, 2024
1 parent 259c045 commit 894c846
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions agentops/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,10 @@ def end_session(
return None

Check warning on line 285 in agentops/session.py

View check run for this annotation

Codecov / codecov/patch

agentops/session.py#L284-L285

Added lines #L284 - L285 were not covered by tests

try:
# Force flush any pending spans before ending session
if hasattr(self, "_span_processor"):
self._span_processor.force_flush(timeout_millis=5000)

# 1. Set shutdown flag on exporter first
if hasattr(self, "_otel_exporter"):
self._otel_exporter.shutdown()
Expand Down

0 comments on commit 894c846

Please sign in to comment.