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

chore(deps): update dependency sentry-sdk to v2 #11492

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 25, 2024

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
sentry-sdk (changelog) >=1.45.0,<2.0 -> >=1.45.0,<2.2 age adoption passing confidence

Release Notes

getsentry/sentry-python (sentry-sdk)

v2.1.1

Compare Source

v2.1.0

Compare Source

v2.0.1

Compare Source

Various fixes & improvements

v2.0.0

Compare Source

This is the first major update in a long time!

We dropped support for some ancient languages and frameworks (Yes, Python 2.7 is no longer supported). Additionally we refactored a big part of the foundation of the SDK (how data inside the SDK is handled).

We hope you like it!

For a shorter version of what you need to do, to upgrade to Sentry SDK 2.0 see: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x

New Features
  • Additional integrations will now be activated automatically if the SDK detects the respective package is installed: Ariadne, ARQ, asyncpg, Chalice, clickhouse-driver, GQL, Graphene, huey, Loguru, PyMongo, Quart, Starlite, Strawberry.
  • Added new API for custom instrumentation: new_scope, isolation_scope. See the Deprecated section to see how they map to the existing APIs.
Changed

(These changes are all backwards-incompatible. Breaking Change (if you are just skimming for that phrase))

  • The Pyramid integration will not capture errors that might happen in authenticated_userid() in a custom AuthenticationPolicy class.
  • The method need_code_loation of the MetricsAggregator was renamed to need_code_location.
  • The BackgroundWorker thread used to process events was renamed from raven-sentry.BackgroundWorker to sentry-sdk.BackgroundWorker.
  • The reraise function was moved from sentry_sdk._compat to sentry_sdk.utils.
  • The _ScopeManager was moved from sentry_sdk.hub to sentry_sdk.scope.
  • Moved the contents of tracing_utils_py3.py to tracing_utils.py. The start_child_span_decorator is now in sentry_sdk.tracing_utils.
  • The actual implementation of get_current_span was moved to sentry_sdk.tracing_utils. sentry_sdk.get_current_span is still accessible as part of the top-level API.
  • sentry_sdk.tracing_utils.add_query_source(): Removed the hub parameter. It is not necessary anymore.
  • sentry_sdk.tracing_utils.record_sql_queries(): Removed the hub parameter. It is not necessary anymore.
  • sentry_sdk.tracing_utils.get_current_span() does now take a scope instead of a hub as parameter.
  • sentry_sdk.tracing_utils.should_propagate_trace() now takes a Client instead of a Hub as first parameter.
  • sentry_sdk.utils.is_sentry_url() now takes a Client instead of a Hub as first parameter.
  • sentry_sdk.utils._get_contextvars does not return a tuple with three values, but a tuple with two values. The copy_context was removed.
  • If you create a transaction manually and later mutate the transaction in a configure_scope block this does not work anymore. Here is a recipe on how to change your code to make it work:
    Your existing implementation:
    transaction = sentry_sdk.transaction(...)

later in the code execution:

with sentry_sdk.configure_scope() as scope:
    scope.set_transaction_name("new-transaction-name")
```

needs to be changed to this:
```python
transaction = sentry_sdk.transaction(...)

later in the code execution:

scope = sentry_sdk.Scope.get_current_scope()
scope.set_transaction_name("new-transaction-name")
```
  • The classes listed in the table below are now abstract base classes. Therefore, they can no longer be instantiated. Subclasses can only be instantiated if they implement all of the abstract methods.

    Show table
    Class Abstract methods
    sentry_sdk.integrations.Integration setup_once
    sentry_sdk.metrics.Metric add, serialize_value, and weight
    sentry_sdk.profiler.Scheduler setup and teardown
    sentry_sdk.transport.Transport capture_envelope
Removed

(These changes are all backwards-incompatible. Breaking Change (if you are just skimming for that phrase))

  • Removed support for Python 2 and Python 3.5. The SDK now requires at least Python 3.6.
  • Removed support for Celery 3.*.
  • Removed support for Django 1.8, 1.9, 1.10.
  • Removed support for Flask 0.*.
  • Removed support for gRPC < 1.39.
  • Removed support for Tornado < 6.
  • Removed last_event_id() top level API. The last event ID is still returned by capture_event(), capture_exception() and capture_message() but the top level API sentry_sdk.last_event_id() has been removed.
  • Removed support for sending events to the /store endpoint. Everything is now sent to the /envelope endpoint. If you're on SaaS you don't have to worry about this, but if you're running Sentry yourself you'll need version 20.6.0 or higher of self-hosted Sentry.
  • The deprecated with_locals configuration option was removed. Use include_local_variables instead. See https://docs.sentry.io/platforms/python/configuration/options/#include-local-variables.
  • The deprecated request_bodies configuration option was removed. Use max_request_body_size. See https://docs.sentry.io/platforms/python/configuration/options/#max-request-body-size.
  • Removed support for user.segment. It was also removed from the trace header as well as from the dynamic sampling context.
  • Removed support for the install method for custom integrations. Please use setup_once instead.
  • Removed sentry_sdk.tracing.Span.new_span. Use sentry_sdk.tracing.Span.start_child instead.
  • Removed sentry_sdk.tracing.Transaction.new_span. Use sentry_sdk.tracing.Transaction.start_child instead.
  • Removed support for creating transactions via sentry_sdk.tracing.Span(transaction=...). To create a transaction, please use sentry_sdk.tracing.Transaction(name=...).
  • Removed sentry_sdk.utils.Auth.store_api_url.
  • sentry_sdk.utils.Auth.get_api_url's now accepts a sentry_sdk.consts.EndpointType enum instead of a string as its only parameter. We recommend omitting this argument when calling the function, since the parameter's default value is the only possible sentry_sdk.consts.EndpointType value. The parameter exists for future compatibility.
  • Removed tracing_utils_py2.py. The start_child_span_decorator is now in sentry_sdk.tracing_utils.
  • Removed the sentry_sdk.profiler.Scheduler.stop_profiling method. Any calls to this method can simply be removed, since this was a no-op method.
Deprecated

do something


After:

```python
import sentry_sdk

with sentry_sdk.start_span(...):

### do something
  • Hub cloning is deprecated.

    Before:

    with Hub(Hub.current) as hub:

do something with the cloned hub


After:

```python
import sentry_sdk

with sentry_sdk.isolation_scope() as scope:

### do something with the forked scope
  • configure_scope is deprecated. Use the new isolation scope directly via Scope.get_isolation_scope() instead.

    Before:

    with configure_scope() as scope:

do something with scope


After:

```python
from sentry_sdk.scope import Scope

scope = Scope.get_isolation_scope()

Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot added the dependencies Third-party library dependencies. label Apr 25, 2024
@renovate renovate bot enabled auto-merge (rebase) April 25, 2024 10:10
@nijel
Copy link
Member

nijel commented Apr 25, 2024

Needs code changes!

Migration guide: https://docs.sentry.io/platforms/python/migration/1.x-to-2.x

It is unclear how to address last_event_id() removal, see getsentry/sentry-python#3016

@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch from 5ce9fba to 8709812 Compare April 25, 2024 12:07
@renovate renovate bot changed the title chore(deps): update dependency sentry-sdk to v2 Update dependency sentry-sdk to v2 Apr 25, 2024
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch from 8709812 to 22e06b7 Compare April 25, 2024 12:15
@renovate renovate bot changed the title Update dependency sentry-sdk to v2 chore(deps): update dependency sentry-sdk to v2 Apr 25, 2024
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch 2 times, most recently from 0b4736f to 99f1249 Compare April 25, 2024 12:53
@renovate renovate bot changed the title chore(deps): update dependency sentry-sdk to v2 Update dependency sentry-sdk to v2 Apr 25, 2024
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch from 99f1249 to c5a2707 Compare April 25, 2024 16:36
@renovate renovate bot changed the title Update dependency sentry-sdk to v2 chore(deps): update dependency sentry-sdk to v2 Apr 25, 2024
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch 15 times, most recently from 68292ca to 8caadc4 Compare April 28, 2024 18:07
@renovate renovate bot changed the title chore(deps): update dependency sentry-sdk to v2 Update dependency sentry-sdk to v2 Apr 28, 2024
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch 2 times, most recently from 1290a11 to ef5ad87 Compare April 28, 2024 23:34
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch from 379f811 to 2554df9 Compare May 10, 2024 09:10
@nijel
Copy link
Member

nijel commented May 10, 2024

Sentry will bring this interface back, see getsentry/sentry-python#3057

@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch 20 times, most recently from f9aa7df to 95b9da2 Compare May 15, 2024 13:05
@renovate renovate bot force-pushed the renovate/sentry-sdk-2.x branch from 95b9da2 to c873b62 Compare May 16, 2024 00:42
@nijel nijel mentioned this pull request May 16, 2024
5 tasks
@nijel
Copy link
Member

nijel commented May 16, 2024

Superseeded by #11650

@nijel nijel closed this May 16, 2024
auto-merge was automatically disabled May 16, 2024 05:39

Pull request was closed

Copy link
Contributor Author

renovate bot commented May 16, 2024

Renovate Ignore Notification

Because you closed this PR without merging, Renovate will ignore this update. You will not get PRs for any future 2.x releases. But if you manually upgrade to 2.x then Renovate will re-enable minor and patch updates automatically.

If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.

@renovate renovate bot deleted the renovate/sentry-sdk-2.x branch May 16, 2024 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Third-party library dependencies.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant