Skip to content

[DO NOT MERGE] ref(log): Migrate to individual sentry-tracing layers - #735

Closed
sentry-junior[bot] wants to merge 1 commit into
mainfrom
szokeasaurusrex/sentry-tracing-layers-dnm
Closed

sentry-junior[bot] wants to merge 1 commit into
mainfrom
szokeasaurusrex/sentry-tracing-layers-dnm

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Caution

DO NOT MERGE. This PR points the Sentry Rust SDK at an unreleased branch to test the new sentry-tracing API from getsentry/sentry-rust#1348 (stacked on getsentry/sentry-rust#1342) against a real codebase.

SDK bump

All sentry-* crates are redirected to the szokeasaurusrex/deprecate-tracing-helpers branch with [patch.crates-io]. I did not change the sentry = "0.49.3" requirement. sentry_arroyo and objectstore-client depend on sentry-core from crates.io. Changing only the sentry requirement would have pulled in a second copy of sentry-core, and the two copies would use separate Hubs. With the patch, Cargo.lock has a single git-sourced copy of each SDK crate, pinned to 2d59a99. The only lockfile changes are the source and checksum lines.

Migration

The migration followed the SentryLayer migration 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 the EventFilter flags. That makes the mapping direct:

  • objectstore-log subscriber. The old config was:

    • span_filter: everything except TRACE
    • event_filter: ERROR/WARN → Event | Log, INFO/DEBUG → Log, TRACE → Ignore

    Here is how that maps to the new layers:

    • SpanLayer with LevelFilter::DEBUG
    • ErrorLayer with LevelFilter::WARN
    • LogLayer with LevelFilter::DEBUG
    • no BreadcrumbLayer, because the old filter never returned EventFilter::Breadcrumb

    The three filtered layers are combined with .and_then(..) into one layer. That keeps the existing Option<_> shape, so the layer is still skipped when the Sentry client is disabled. ErrorLayer comes before LogLayer, which keeps the legacy layer's order (error first, then log). enable_span_attributes was not used, so there was nothing to carry over.

  • body_task_preserves_sentry_context test. The test used layer().span_filter(!= TRACE) and only checks transactions, so it now uses just SpanLayer::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

  • I used LevelFilters instead of filter_fn closures because every old filter was a level threshold.
  • I used a branch reference instead of a rev, so updating to newer PR commits only takes cargo update -p sentry. The lockfile still pins the exact commit.

I found no case the migration guide didn't cover. There are no event_mapper usages here, which is the one case the guide says may not have a direct replacement.

via @szokeasaurusrex.

--

View Junior Session [Sentry]

Co-Authored-By: Daniel Szoke <7881302+szokeasaurusrex@users.noreply.github.com>
@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.92%. Comparing base (f810ab2) to head (c6b0a33).
⚠️ Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
objectstore-log/src/subscriber.rs 0.00% 4 Missing ⚠️
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     
Components Coverage Δ
Rust Backend 94.92% <100.00%> (-0.01%) ⬇️
Rust Client 82.86% <ø> (ø)
Python Client 93.73% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant