Important
-
We're making
enable_logsandenable_metricsno-op with this release (#7177), and they'll be dropped in the next major.Previously,
enable_logsalso controlled automatic logs collection from the logging and Loguru integrations. These integrations now get an integration-levelcapture_sentry_logsboolean option to allow for more control over the auto-collection. These options areFalseby default, i.e., nothing is auto-collected without your explicit opt-in.Action Needed
If you had
enable_logsset toTrue:- If you were using the
sentry_sdk.logger.XAPI, no action necessary, the API will just work. - If you were auto-collecting logs from either
LoggingIntegrationorLoguruIntegration, the auto-collection will be turned off in this release. You can switch auto-collection on explicitly with:
import sentry_sdk from sentry_sdk.integrations.logging import LoggingIntegration from sentry_sdk.integrations.loguru import LoguruIntegration sentry_sdk.init( integrations=[ LoggingIntegration(capture_sentry_logs=True), LoguruIntegration(capture_sentry_logs=True), ], )
If you had
enable_logsset toFalse:- If you were using it to gate usages of the
sentry_sdk.logger.XAPI, you'll need to remove the calls entirely or define abefore_send_logcallback to filter out unwanted logs.
If you has
enable_metricsset toFalse:- Any metrics emitted using the metrics API will be emitted. You'll need to drop them in a
before_send_metricor remove the calls to the API.
Why We're Doing This
We recognize this is a disruptive change for some folks and want to make it clear this is a one-off. We're removing the options because they were an unnecessary hurdle that one had to jump through to be able to use logs and metrics, and it was confusing why the logging API would not just work on its own. On the other hand, we wanted to give you more fine-grained control over automatic collection.
- If you were using the
New Features ✨
Other
- Set the segment source on the scope for
NoOpStreamedSpanby @alexander-alderman-webb in #7163 - Remove early return for
NoOpStreamedSpaninset_transaction_name()by @alexander-alderman-webb in #7164 - Set the segment name on the scope with
NoOpStreamedSpanby @alexander-alderman-webb in #7162
Bug Fixes 🐛
- (batcher) Add global flush trigger based on the span number by @alexander-alderman-webb in #7150
Internal Changes 🔧
HTTPX, HTTPX2
- Move crumbs to integrations by @sentrivana in #7149
- Split into sync/async tests by @sentrivana in #7152
Other
- (aiohttp) Move crumbs to integration by @sentrivana in #7135
- (boto3) Move crumbs to integration by @sentrivana in #7165
- (django) Remove dead code and stale markers from the Django test suite by @ericapisani in #7156
- (pyreqwest) Move crumbs to integration by @sentrivana in #7148
- (stdlib) Move crumbs to integration by @sentrivana in #7161
- Flush trace buckets when segment spans finish by @alexander-alderman-webb in #7170
- Revert global span batcher limits by @alexander-alderman-webb in #7168