Skip to content

Commit e46aa88

Browse files
committed
Transactions in transactins is undefined behavior, so remove this.
1 parent 9a1fbb4 commit e46aa88

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

sentry_sdk/integrations/arq.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ async def _sentry_run_job(self, job_id, score):
104104
with sentry_sdk.isolation_scope() as scope:
105105
scope._name = "arq"
106106
scope.set_transaction_name(
107-
DEFAULT_TRANSACTION_NAME, source=TRANSACTION_SOURCE_TASK,
107+
DEFAULT_TRANSACTION_NAME,
108+
source=TRANSACTION_SOURCE_TASK,
108109
)
109110
scope.clear_breadcrumbs()
110111

tests/integrations/opentelemetry/test_utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,7 @@ def test_span_data_for_db_query():
334334
),
335335
(
336336
SpanKind.SERVER,
337-
Status(
338-
StatusCode.ERROR, "I'm a teapot"
339-
),
337+
Status(StatusCode.ERROR, "I'm a teapot"),
340338
{
341339
"http.method": "POST",
342340
"http.route": "/some/route",

tests/integrations/rq/test_rq.py

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
from fakeredis import FakeStrictRedis
66

77
import sentry_sdk
8-
from sentry_sdk import start_transaction
98
from sentry_sdk.integrations.rq import RqIntegration
109
from sentry_sdk.utils import parse_version
1110

@@ -164,16 +163,14 @@ def test_tracing_enabled(
164163
queue = rq.Queue(connection=FakeStrictRedis())
165164
worker = rq.SimpleWorker([queue], connection=queue.connection)
166165

167-
with start_transaction(op="rq transaction") as transaction:
168-
queue.enqueue(crashing_job, foo=None)
169-
worker.work(burst=True)
166+
queue.enqueue(crashing_job, foo=None)
167+
worker.work(burst=True)
170168

171-
error_event, envelope, _ = events
169+
error_event, transaction = events
172170

173171
assert error_event["transaction"] == "tests.integrations.rq.test_rq.crashing_job"
174-
assert error_event["contexts"]["trace"]["trace_id"] == transaction.trace_id
175-
176-
assert envelope["contexts"]["trace"] == error_event["contexts"]["trace"]
172+
assert transaction["transaction"] == "tests.integrations.rq.test_rq.crashing_job"
173+
assert transaction["contexts"]["trace"] == error_event["contexts"]["trace"]
177174

178175

179176
@pytest.mark.forked

0 commit comments

Comments
 (0)