Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the deprecated sentry tracing extension #3672

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Release type: minor

After a year-long deprecation period, the `SentryTracingExtension` has been
removed in favor of the official Sentry SDK integration.

To migrate, remove the `SentryTracingExtension` from your Strawberry schema and
then follow the
[official Sentry SDK integration guide](https://docs.sentry.io/platforms/python/integrations/strawberry/).
8 changes: 8 additions & 0 deletions TWEET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
After a year-long deprecation period, the SentryTracingExtension has
been removed in favor of the official Sentry SDK integration.

Checkout out our migration guides if you have not migrated yet.

Thanks to $contributor for the PR 👏

$release_url
1 change: 1 addition & 0 deletions docs/breaking-changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ title: List of breaking changes and deprecations

# List of breaking changes and deprecations

- [Version 0.249.0 - 18 November 2024](./breaking-changes/0.249.0.md)
- [Version 0.243.0 - 25 September 2024](./breaking-changes/0.243.0.md)
- [Version 0.240.0 - 10 September 2024](./breaking-changes/0.240.0.md)
- [Version 0.236.0 - 17 July 2024](./breaking-changes/0.236.0.md)
Expand Down
13 changes: 13 additions & 0 deletions docs/breaking-changes/0.249.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: 0.249.0 Breaking Changes
slug: breaking-changes/0.249.0
---

# v0.249.0 Breaking Changes

After a year-long deprecation period, the `SentryTracingExtension` has been
removed in favor of the official Sentry SDK integration.

To migrate, remove the `SentryTracingExtension` from your Strawberry schema and
then follow the
[official Sentry SDK integration guide](https://docs.sentry.io/platforms/python/integrations/strawberry/).
68 changes: 8 additions & 60 deletions docs/extensions/sentry-tracing.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,68 +4,16 @@ summary: Add Sentry tracing to your GraphQL server.
tags: tracing
---

<Warning>

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](https://github.com/getsentry/sentry-python/releases/tag/1.32.0).

Below is the revised usage example:

```python
import sentry_sdk
from 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,
)
```

</Warning>

# `SentryTracingExtension`

This extension adds support for tracing with Sentry.

## Usage example:

```python
import strawberry
from strawberry.extensions.tracing import SentryTracingExtension

schema = strawberry.Schema(
Query,
extensions=[
SentryTracingExtension,
],
)
```

<Note>

If you are not running in an Async context then you'll need to use the sync
version:

```python
import strawberry
from strawberry.extensions.tracing import SentryTracingExtensionSync

schema = strawberry.Schema(
Query,
extensions=[
SentryTracingExtensionSync,
],
)
```
<Warning>

</Note>
As of Sentry 1.32.0, Strawberry is officially supported by the Sentry SDK.
DoctorJohn marked this conversation as resolved.
Show resolved Hide resolved
Therefore, Strawberry's `SentryTracingExtension` has been deprecated in version
0.210.0 and finally removed with Strawberry 0.249.0 in favor of the official
Sentry SDK integration.

## API reference:
For more details, please refer to the
[documentation for the official Sentry Strawberry integration](https://docs.sentry.io/platforms/python/integrations/strawberry/).

_No arguments_
</Warning>
49 changes: 1 addition & 48 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ pytest-xdist = {extras = ["psutil"], version = "^3.1.0"}
python-multipart = ">=0.0.7"
rich = {version = ">=12.5.1", optional = false}
sanic-testing = ">=22.9,<24.0"
sentry-sdk = "^1.39.2"
typer = {version = ">=0.7.0", optional = false}
types-aiofiles = ">=22.1"
types-certifi = "^2021.10.8"
Expand Down
6 changes: 0 additions & 6 deletions strawberry/extensions/tracing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
OpenTelemetryExtension,
OpenTelemetryExtensionSync,
)
from .sentry import SentryTracingExtension, SentryTracingExtensionSync

__all__ = [
"ApolloTracingExtension",
Expand All @@ -17,8 +16,6 @@
"DatadogTracingExtensionSync",
"OpenTelemetryExtension",
"OpenTelemetryExtensionSync",
"SentryTracingExtension",
"SentryTracingExtensionSync",
]


Expand All @@ -32,7 +29,4 @@ def __getattr__(name: str) -> Any:
if name in {"OpenTelemetryExtension", "OpenTelemetryExtensionSync"}:
return getattr(importlib.import_module(".opentelemetry", __name__), name)

if name in {"SentryTracingExtension", "SentryTracingExtensionSync"}:
return getattr(importlib.import_module(".sentry", __name__), name)

raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
161 changes: 0 additions & 161 deletions strawberry/extensions/tracing/sentry.py

This file was deleted.

Loading
Loading