Sentry Rust SDK: sentry-tracing
Adds support for automatic Breadcrumb, Event and Transaction capturing from
tracing events, similar to the sentry-log crate.
The tracing crate is supported in three ways. First, events can be captured
as breadcrumbs for later. Secondly, error events can be captured as events
to Sentry. Finally, spans can be recorded as structured transaction events.
By default, events above Info are recorded as breadcrumbs, events above
Error are captured as error events, and spans above Info are recorded
as transactions.
By using this crate in combination with tracing-subscriber and its log
integration, sentry-log does not need to be used, as logs will be ingested
in the tracing system and generate events, thus be relayed to this crate. It
effectively replaces sentry-log when tracing is used.
Examples
use Duration;
use sleep;
use *;
async
// Functions instrumented by tracing automatically report
// their span as transactions
async
async
Or one might also set an explicit filter, to customize how to treat log records:
use EventFilter;
use *;
let layer = layer.event_filter;
registry.with.init;
Resources
License: Apache-2.0
- Discord server for project discussions.
- Follow @getsentry on Twitter for updates