From bbfd350adbddd8130b7d1ac54f95f0b5325c5b7e Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 25 Jun 2024 10:53:10 -0700 Subject: [PATCH 1/2] Update strawberry.py to start a transaction instead of a span Operations in Grapqhl are logically equivalent units to Views in HTTP - and should use a transaction instead of a span as the parent object. They represent a single activity instance we want to measure or track. Making them a transaction enables us to have visibility of them at the Performance metric tab and see which operations are simply causing a high load. --- sentry_sdk/integrations/strawberry.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sentry_sdk/integrations/strawberry.py b/sentry_sdk/integrations/strawberry.py index 5c16c60ff2..5d981669d7 100644 --- a/sentry_sdk/integrations/strawberry.py +++ b/sentry_sdk/integrations/strawberry.py @@ -184,8 +184,8 @@ def on_operation(self): origin=StrawberryIntegration.origin, ) else: - self.graphql_span = sentry_sdk.start_span( - op=op, + self.graphql_span = sentry_sdk.start_transaction( + name=op, description=description, origin=StrawberryIntegration.origin, ) From 7783920c7559b10822b9ee7c681882664d85ef8e Mon Sep 17 00:00:00 2001 From: Keith Date: Tue, 25 Jun 2024 14:30:58 -0700 Subject: [PATCH 2/2] Update strawberry.py --- sentry_sdk/integrations/strawberry.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sentry_sdk/integrations/strawberry.py b/sentry_sdk/integrations/strawberry.py index 5d981669d7..f1968f6409 100644 --- a/sentry_sdk/integrations/strawberry.py +++ b/sentry_sdk/integrations/strawberry.py @@ -185,8 +185,7 @@ def on_operation(self): ) else: self.graphql_span = sentry_sdk.start_transaction( - name=op, - description=description, + name=description, origin=StrawberryIntegration.origin, )