Repository navigation
[DO NOT MERGE] ref(log): Migrate to individual sentry-tracing layers - #735
Closed
sentry-junior[bot] wants to merge 1 commit into
Closed
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
Co-Authored-By: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #735 +/- ##
==========================================
+ Coverage 91.91% 91.92% +0.01%
==========================================
Files 117 117
Lines 24141 24138 -3
==========================================
Hits 22188 22188
+ Misses 1953 1950 -3
☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Caution
DO NOT MERGE. This PR points the Sentry Rust SDK at an unreleased branch to test the new
sentry-tracingAPI from getsentry/sentry-rust#1348 (stacked on getsentry/sentry-rust#1342) against a real codebase.SDK bump
All
sentry-*crates are redirected to theszokeasaurusrex/deprecate-tracing-helpersbranch with[patch.crates-io]. I did not change thesentry = "0.49.3"requirement.sentry_arroyoandobjectstore-clientdepend onsentry-corefrom crates.io. Changing only thesentryrequirement would have pulled in a second copy ofsentry-core, and the two copies would use separate Hubs. With the patch,Cargo.lockhas a single git-sourced copy of each SDK crate, pinned to2d59a99. The only lockfile changes are the source and checksum lines.Migration
The migration followed the
SentryLayermigration guide ("Migrating custom configuration") on that branch. The legacy layer is now just a wrapper that sends each event to the inner span, error, breadcrumb, and log layers based on theEventFilterflags. That makes the mapping direct:objectstore-logsubscriber. The old config was:span_filter: everything exceptTRACEevent_filter:ERROR/WARN→Event | Log,INFO/DEBUG→Log,TRACE→IgnoreHere is how that maps to the new layers:
SpanLayerwithLevelFilter::DEBUGErrorLayerwithLevelFilter::WARNLogLayerwithLevelFilter::DEBUGBreadcrumbLayer, because the old filter never returnedEventFilter::BreadcrumbThe three filtered layers are combined with
.and_then(..)into one layer. That keeps the existingOption<_>shape, so the layer is still skipped when the Sentry client is disabled.ErrorLayercomes beforeLogLayer, which keeps the legacy layer's order (error first, then log).enable_span_attributeswas not used, so there was nothing to carry over.body_task_preserves_sentry_contexttest. The test usedlayer().span_filter(!= TRACE)and only checks transactions, so it now uses justSpanLayer::new().with_filter(LevelFilter::DEBUG). One difference: the legacy layer's default event filter would also have captured error events, breadcrumbs, and logs. The test never checked those, so I left them out.Decisions
LevelFilters instead offilter_fnclosures because every old filter was a level threshold.rev, so updating to newer PR commits only takescargo update -p sentry. The lockfile still pins the exact commit.I found no case the migration guide didn't cover. There are no
event_mapperusages here, which is the one case the guide says may not have a direct replacement.via @szokeasaurusrex.
--
View Junior Session [Sentry]