Bump sentry-sdk[starlette] from 1.40.0 to 2.0.0
Bumps sentry-sdk[starlette] from 1.40.0 to 2.0.0.
Release notes
Sourced from sentry-sdk[starlette]'s releases.
2.0.0
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 customAuthenticationPolicy
class.The method
need_code_loation
of theMetricsAggregator
was renamed toneed_code_location
.The
BackgroundWorker
thread used to process events was renamed fromraven-sentry.BackgroundWorker
tosentry-sdk.BackgroundWorker
.The
reraise
function was moved fromsentry_sdk._compat
tosentry_sdk.utils
.The
_ScopeManager
was moved fromsentry_sdk.hub
tosentry_sdk.scope
.Moved the contents of
tracing_utils_py3.py
totracing_utils.py
. Thestart_child_span_decorator
is now insentry_sdk.tracing_utils
.The actual implementation of
get_current_span
was moved tosentry_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 thehub
parameter. It is not necessary anymore.
sentry_sdk.tracing_utils.record_sql_queries()
: Removed thehub
parameter. It is not necessary anymore.
sentry_sdk.tracing_utils.get_current_span()
does now take ascope
instead of ahub
as parameter.
sentry_sdk.tracing_utils.should_propagate_trace()
now takes aClient
instead of aHub
as first parameter.
sentry_sdk.utils.is_sentry_url()
now takes aClient
instead of aHub
as first parameter.
sentry_sdk.utils._get_contextvars
does not return a tuple with three values, but a tuple with two values. Thecopy_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:
transaction = sentry_sdk.transaction(...) later in the code execution: scope = sentry_sdk.Scope.get_current_scope() scope.set_transaction_name("new-transaction-name")
... (truncated)
Changelog
Sourced from sentry-sdk[starlette]'s changelog.
2.0.0
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 customAuthenticationPolicy
class.The method
need_code_loation
of theMetricsAggregator
was renamed toneed_code_location
.The
BackgroundWorker
thread used to process events was renamed fromraven-sentry.BackgroundWorker
tosentry-sdk.BackgroundWorker
.The
reraise
function was moved fromsentry_sdk._compat
tosentry_sdk.utils
.The
_ScopeManager
was moved fromsentry_sdk.hub
tosentry_sdk.scope
.Moved the contents of
tracing_utils_py3.py
totracing_utils.py
. Thestart_child_span_decorator
is now insentry_sdk.tracing_utils
.The actual implementation of
get_current_span
was moved tosentry_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 thehub
parameter. It is not necessary anymore.
sentry_sdk.tracing_utils.record_sql_queries()
: Removed thehub
parameter. It is not necessary anymore.
sentry_sdk.tracing_utils.get_current_span()
does now take ascope
instead of ahub
as parameter.
sentry_sdk.tracing_utils.should_propagate_trace()
now takes aClient
instead of aHub
as first parameter.
sentry_sdk.utils.is_sentry_url()
now takes aClient
instead of aHub
as first parameter.
sentry_sdk.utils._get_contextvars
does not return a tuple with three values, but a tuple with two values. Thecopy_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:
transaction = sentry_sdk.transaction(...) later in the code execution: scope = sentry_sdk.Scope.get_current_scope() scope.set_transaction_name("new-transaction-name")
... (truncated)
Commits
-
38bbb8d
Updated changelog -
abca568
Updated changelog -
0b454c0
Updated changelog -
2642c8a
Updated changelog -
cc1dbc0
release: 2.0.0 -
74310f0
Merge branch 'release/2.0.0rc6' into sentry-sdk-2.0 -
62d4c48
release: 2.0.0rc6 -
17715c0
Restore original behavior by always creating a span (#3005) -
7ef20df
Merge baggage headers (incoming and new created ones) (#3001) -
9fc2f44
Fix duplicate baggage headers in Celery integration introduced in SDK 2.0 (#2... - Additional commits viewable in compare view