Skip to content

fix(openai): stop setting transaction status on AI span errors#5862

Closed
NIK-TIGER-BILL wants to merge 1 commit intogetsentry:masterfrom
NIK-TIGER-BILL:fix/openai-stop-setting-transaction-status
Closed

fix(openai): stop setting transaction status on AI span errors#5862
NIK-TIGER-BILL wants to merge 1 commit intogetsentry:masterfrom
NIK-TIGER-BILL:fix/openai-stop-setting-transaction-status

Conversation

@NIK-TIGER-BILL
Copy link

Description

AI integrations should not interfere with HTTP transactions.

_capture_exception() called set_span_errored(current_span) which propagated INTERNAL_ERROR to the containing HTTP transaction. Replace with a direct current_span.set_status() call that only marks the AI span errored.

  • sentry_sdk/integrations/openai.pyset_span_errored removed, direct set_status used
  • tests/integrations/openai/test_openai.py — transaction status assertion updated

Issues

AI integrations should not interfere with HTTP transactions.

_capture_exception() called set_span_errored(current_span) which
propagated INTERNAL_ERROR to the containing HTTP transaction.

Replace with a direct current_span.set_status() call that only marks
the AI span errored.

Fixes getsentry#5789

Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai: Stop setting transaction status

2 participants