Skip to content

Commit 530d32a

Browse files
authored
Cleanup unnecessary calls to generate_propagation_context (#2867)
1 parent e2140fa commit 530d32a

File tree

4 files changed

+1
-7
lines changed

4 files changed

+1
-7
lines changed

sentry_sdk/integrations/celery.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,7 @@ def sentry_apply_entry(*args, **kwargs):
499499
if match_regex_list(monitor_name, integration.exclude_beat_tasks):
500500
return original_apply_entry(*args, **kwargs)
501501

502+
# TODO: xxx we need to check this can be removed and we should for an isolatino scope here!
502503
# When tasks are started from Celery Beat, make sure each task has its own trace.
503504
scope = Scope.get_isolation_scope()
504505
scope.set_new_propagation_context()

sentry_sdk/integrations/flask.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ def _request_started(app, **kwargs):
127127
)
128128

129129
scope = Scope.get_isolation_scope()
130-
scope.generate_propagation_context()
131130
evt_processor = _make_request_event_processor(app, request, integration)
132131
scope.add_event_processor(evt_processor)
133132

sentry_sdk/integrations/graphene.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ def _sentry_patched_graphql_sync(schema, source, *args, **kwargs):
5353
return old_graphql_sync(schema, source, *args, **kwargs)
5454

5555
scope = Scope.get_isolation_scope()
56-
scope.generate_propagation_context()
5756
scope.add_event_processor(_event_processor)
5857

5958
result = old_graphql_sync(schema, source, *args, **kwargs)
@@ -80,7 +79,6 @@ async def _sentry_patched_graphql_async(schema, source, *args, **kwargs):
8079
return await old_graphql_async(schema, source, *args, **kwargs)
8180

8281
scope = Scope.get_isolation_scope()
83-
scope.generate_propagation_context()
8482
scope.add_event_processor(_event_processor)
8583

8684
result = await old_graphql_async(schema, source, *args, **kwargs)

sentry_sdk/integrations/strawberry.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ def on_operation(self):
176176
)
177177

178178
scope = Scope.get_isolation_scope()
179-
scope.generate_propagation_context()
180179
if scope.span:
181180
self.graphql_span = scope.span.start_child(op=op, description=description)
182181
else:
@@ -273,7 +272,6 @@ async def _sentry_patched_execute_async(*args, **kwargs):
273272

274273
if "execution_context" in kwargs and result.errors:
275274
scope = Scope.get_isolation_scope()
276-
scope.generate_propagation_context()
277275
event_processor = _make_request_event_processor(kwargs["execution_context"])
278276
scope.add_event_processor(event_processor)
279277

@@ -286,7 +284,6 @@ def _sentry_patched_execute_sync(*args, **kwargs):
286284

287285
if "execution_context" in kwargs and result.errors:
288286
scope = Scope.get_isolation_scope()
289-
scope.generate_propagation_context()
290287
event_processor = _make_request_event_processor(kwargs["execution_context"])
291288
scope.add_event_processor(event_processor)
292289

@@ -322,7 +319,6 @@ def _sentry_patched_handle_errors(self, errors, response_data):
322319
return
323320

324321
scope = Scope.get_isolation_scope()
325-
scope.generate_propagation_context()
326322
event_processor = _make_response_event_processor(response_data)
327323
scope.add_event_processor(event_processor)
328324

0 commit comments

Comments
 (0)