
Sentry SDK for Rust
https://github.com/getsentry/sentry-rust- Category
- Developer Tools
- Rank
- No. 368Tools index
- Pricing
- Open Source
- Type
- TOOL
- Builder
- getsentry
- GitHub
- 751 stars
- Latest release
- 0.49.2
- Date
About
Official Sentry SDK for Rust. Capture panics, errors, and performance traces from Rust services.
What it does
It gives Rust applications a modular telemetry client built around clients, hubs, and scopes. Applications can attach context, breadcrumbs, logs, metrics, and request data before sending events through selectable HTTP transports. Separate crates connect common web, logging, tracing, and error-handling ecosystems.
Why it's ranked here
The breadth is compelling: one workspace covers application use, integration authors, several web stacks, multiple logging systems, OpenTelemetry, and four transport choices. The main reservation is API stability. The project explicitly remains pre-1.0 and may introduce breaking changes between minor releases.
What's good
Feature flags let teams choose integrations and transport stacks instead of accepting one fixed dependency set. Default support includes backtraces, runtime context, panic handling, structured logs, metrics, and loaded-library metadata. Dedicated Actix and Tower layers isolate request context, while test support can capture emitted events for inspection.
Tradeoffs
Rust 1.88 is the minimum supported compiler, and that floor can rise with dependencies. Concurrent threads and futures require correctly copied and bound hubs; sharing one concurrently can produce unexpected results or panics. Applications must retain the initialization guard, and shutdown may wait up to two seconds while queued events flush.
How to use it well
Use it in Rust applications already sending operational data to Sentry, especially services built with Actix, Tower, Axum, Tonic, tracing, log, slog, anyhow, or OpenTelemetry. Start with the application crate and enable only needed features. Library and integration authors should prefer the minimal core crate. It does not provide the Sentry server or replace the analysis service.
Technical notes+
Cargo.toml defines a resolver 2 workspace with 14 member crates and Rust edition 2021. sentry/src/lib.rs re-exports sentry-core, applies default integrations, and exposes feature-gated transports and ecosystem adapters. sentry-core/src/lib.rs centers the API on Client, Hub, Scope, Integration, and Transport, with a minimal mode that blackholes many operations until the client feature is enabled. sentry/build.rs selects reqwest, curl, ureq, or embedded-svc HTTP capability through cfg aliases. sentry-contexts/build.rs generates compiler version, release channel, architecture, and Windows platform constants. sentry-actix/src/lib.rs creates a Hub per request and can attach request data or start transactions. sentry-tower/src/lib.rs binds hubs through Tower layers and warns that incorrect Axum layer ordering can leak memory. sentry-panic/src/lib.rs installs a once-only panic hook, captures a fatal event with stacktrace, flushes the client, then forwards to the previous hook.
Observed
- Primary language
- Rust, with a Python maintenance script included.
- Packaging
- Cargo workspace whose crates are published through crates.io and documented on docs.rs.
- Interface
- Rust library SDK composed of an application crate, a minimal core crate, protocol types, and integration crates.
- Compiler support
- Minimum supported Rust version is 1.88.
- Service compatibility
- Verified against hosted Sentry; the README says it should work with on-prem Sentry 20.6 and later.
- Workspace structure
- Cargo.toml lists 14 member crates.
- Transport surface
- Feature-gated support includes reqwest, curl, ureq, native TLS, rustls, and embedded-svc HTTP.
- Integration surface
- Dedicated integrations cover Actix, Tower, anyhow, panic handling, log, slog, tracing, and OpenTelemetry.
Read from README.md, Cargo.toml, sentry/build.rs, sentry-contexts/build.rs, scripts/commit-msg-expand-issues.py, sentry/src/lib.rs, sentry-log/src/lib.rs, sentry-core/src/lib.rs, sentry-slog/src/lib.rs, sentry-core/src/api.rs, sentry-actix/src/lib.rs, sentry-panic/src/lib.rs, sentry-tower/src/lib.rs, sentry-types/src/lib.rs, sentry-anyhow/src/lib.rs.
What it can do
Capture Rust panic events
Rust application with panic occurrences → Panic event data sent to Sentry
Capture error events
Rust application errors and exceptions → Error event data sent to Sentry
Track performance traces
Rust service operations and transactions → Performance timing data sent to Sentry
Instrument code for monitoring
Rust source code → Instrumented code with Sentry tracking
Collect application context
Rust application runtime state → Contextual metadata attached to events
Filter and sample events
Raw error and performance events → Filtered subset of events based on configured rules
Tags
Tech Stack
Media

Comments (0)
No comments yet
Editorially curated, with community endorsements as a secondary signal. Corrections welcome.