Skip to content

feat(deps): update rust crate sentry to 0.49.0 & migrate to new API - #115

Merged
intgr merged 3 commits into
renovate/sentry-rust-monorepofrom
copilot/fix-github-actions-tests-build
Aug 12, 2026
Merged

feat(deps): update rust crate sentry to 0.49.0 & migrate to new API#115
intgr merged 3 commits into
renovate/sentry-rust-monorepofrom
copilot/fix-github-actions-tests-build

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Tests / build is failing because sentry 0.49 changed ClientOptions: it is now non-exhaustive and no longer exposes traces_sample_rate / traces_sampler as struct fields. This PR updates initialization and related assertions to match the new API while keeping existing sampling behavior.

  • Sentry options initialization migration

    • Replaced ClientOptions { ... } struct-literal construction with ClientOptions::new() builder chaining.
    • Moved trace sampling configuration to builder methods:
      • custom sampler path → .traces_sampler(...)
      • fixed-rate path (> 0) → .traces_sample_rate(...)
    • Kept before_send logging and environment configuration intact.
  • Trace sampling strategy compatibility in tests

    • Updated integration test assertion from removed options().traces_sampler field access to matching options().traces_sampling_strategy against TracesSamplingStrategy::Function(_).
let mut opts = ClientOptions::new()
    .before_send(|event| {
        info!("Sending event to Sentry: {}", event.event_id);
        Some(event)
    })
    .environment(environment);

if let Some(sampler) = self.traces_sampler.as_ref().map(Arc::clone) {
    opts = opts.traces_sampler(move |ctx| sampler(ctx));
} else if traces_sample_rate > 0.0 {
    opts = opts.traces_sample_rate(traces_sample_rate);
}

@intgr
intgr marked this pull request as ready for review July 29, 2026 21:37
@renovate
renovate Bot force-pushed the renovate/sentry-rust-monorepo branch from cafa0e6 to 76efb4f Compare August 11, 2026 22:12
@intgr
intgr force-pushed the copilot/fix-github-actions-tests-build branch 4 times, most recently from 9933109 to e59fbf7 Compare August 12, 2026 18:14
@intgr
intgr merged commit 833ce7b into renovate/sentry-rust-monorepo Aug 12, 2026
2 checks passed
@intgr
intgr deleted the copilot/fix-github-actions-tests-build branch August 12, 2026 18:16
@intgr intgr changed the title Fix Tests/build failure after sentry 0.49 ClientOptions API change feat(deps): update rust crate sentry to 0.49.0 & migrate to new API Aug 12, 2026
@intgr

intgr commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Grrr wrong branch target, damn GitHub!

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.

2 participants