Skip to content

Commit

Permalink
Fix arq tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antonpirker committed Dec 17, 2024
1 parent 9d20ffd commit f0b8eb6
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion sentry_sdk/integrations/arq.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import sys

from opentelemetry.trace.status import StatusCode

import sentry_sdk
from sentry_sdk.consts import OP, SPANSTATUS
from sentry_sdk.integrations import DidNotEnable, Integration
Expand Down Expand Up @@ -116,7 +118,14 @@ async def _sentry_run_job(self, job_id, score):
origin=ArqIntegration.origin,
) as span:
return_value = await old_run_job(self, job_id, score)
span.set_status(SPANSTATUS.OK)

status_unset = (
hasattr(span._otel_span, "status")
and span._otel_span.status.status_code == StatusCode.UNSET
)
if status_unset:
span.set_status(SPANSTATUS.OK)

return return_value

Worker.run_job = _sentry_run_job
Expand Down

0 comments on commit f0b8eb6

Please sign in to comment.