fix(anthropic): Patch `AsyncStream.close()` and `AsyncMessageStream.c… · gitcommit90/sentry-python@6d33d36 · GitHub
Skip to content

Commit 6d33d36

Browse files
fix(anthropic): Patch AsyncStream.close() and AsyncMessageStream.close() to finish spans (getsentry#5675)
Finish AI Client Spans when `close()` is called and not merely when the streamed response iterator is consumed or the GC collects the `_iterator` instance variable. The `close()` method closes the HTTP connection.
1 parent 8203912 commit 6d33d36

2 files changed

Lines changed: 292 additions & 50 deletions

File tree

sentry_sdk/integrations/anthropic.py

Lines changed: 76 additions & 50 deletions

0 commit comments

Comments
 (0)