As of Sentry 1.32.0, Strawberry is now supported by default. This extension is no longer necessary. For more details, please refer to the release notes .
Below is the revised usage example:
import sentry_sdkfrom sentry_sdk.integrations.strawberry import StrawberryIntegration
sentry_sdk.init( dsn="___PUBLIC_DSN___", integrations=[ # make sure to set async_execution to False if you're executing # GraphQL queries synchronously StrawberryIntegration(async_execution=True), ], traces_sample_rate=1.0,)
SentryTracingExtension
This extension adds support for tracing with Sentry.
Usage example:
import strawberryfrom strawberry.extensions.tracing import SentryTracingExtension
schema = strawberry.Schema( Query, extensions=[ SentryTracingExtension, ],)
If you are not running in an Async context then you’ll need to use the sync version:
import strawberryfrom strawberry.extensions.tracing import SentryTracingExtensionSync
schema = strawberry.Schema( Query, extensions=[ SentryTracingExtensionSync, ],)
API reference:
No arguments