Sentry Rust SDK: sentry-tracing
Adds support for automatic Breadcrumb and Event capturing from tracing events,
similar to the sentry-log crate.
The tracing crate is supported in two ways. First, events can be captured as
breadcrumbs for later. Secondly, error events can be captured as events to
Sentry. By default, anything above Info is recorded as breadcrumb and
anything above Error is captured as error event.
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 *;
registry
.with
.with
.try_init
.unwrap;
let _sentry = init;
info!;
error!;
// Also works, since log events are ingested by the tracing system
info!;
error!;
Or one might also set an explicit filter, to customize how to treat log records:
use EventFilter;
let layer = layer.filter;
Resources
License: Apache-2.0
- Discord server for project discussions.
- Follow @getsentry on Twitter for updates