diff --git a/CHANGELOG.md b/CHANGELOG.md index b68f28c8..ee07ea9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## Unreleased +## 0.24.1 **Breaking Changes**: diff --git a/sentry-actix/Cargo.toml b/sentry-actix/Cargo.toml index ae219084..82c8edff 100644 --- a/sentry-actix/Cargo.toml +++ b/sentry-actix/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-actix" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,7 +12,7 @@ Sentry client extension for actix-web 3. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core", default-features = false } +sentry-core = { version = "0.24.1", path = "../sentry-core", default-features = false } actix-web = { version = "3", default-features = false } futures-util = { version = "0.3.5", default-features = false } diff --git a/sentry-actix/README.md b/sentry-actix/README.md index 0cb01d57..40d08a31 100644 --- a/sentry-actix/README.md +++ b/sentry-actix/README.md @@ -17,11 +17,9 @@ such as breadcrumbs do not work unless you bind the actix hub. ## Example ```rust -use std::env; use std::io; use actix_web::{get, App, Error, HttpRequest, HttpServer}; -use sentry::Level; #[get("/")] async fn failing(_req: HttpRequest) -> Result { @@ -31,7 +29,7 @@ async fn failing(_req: HttpRequest) -> Result { #[actix_web::main] async fn main() -> io::Result<()> { let _guard = sentry::init(()); - env::set_var("RUST_BACKTRACE", "1"); + std::env::set_var("RUST_BACKTRACE", "1"); HttpServer::new(|| { App::new() @@ -46,14 +44,27 @@ async fn main() -> io::Result<()> { } ``` +## Using Release Health + +The actix middleware will automatically start a new session for each request +when `auto_session_tracking` is enabled and the client is configured to +use `SessionMode::Request`. + +```rust +let _sentry = sentry::init(sentry::ClientOptions { + session_mode: sentry::SessionMode::Request, + auto_session_tracking: true, + ..Default::default() +}); +``` + ## Reusing the Hub -This integration will automatically update the current Hub instance. For example, -the following will capture a message in the current request's Hub: +This integration will automatically create a new per-request Hub from the main Hub, and update the +current Hub instance. For example, the following will capture a message in the current request's Hub: ```rust -use sentry::Level; -sentry::capture_message("Something is not well", Level::Warning); +sentry::capture_message("Something is not well", sentry::Level::Warning); ``` ## Resources diff --git a/sentry-anyhow/Cargo.toml b/sentry-anyhow/Cargo.toml index 27c45874..1d964070 100644 --- a/sentry-anyhow/Cargo.toml +++ b/sentry-anyhow/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-anyhow" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -16,8 +16,8 @@ default = ["backtrace"] backtrace = ["anyhow/backtrace"] [dependencies] -sentry-backtrace = { version = "0.23.0", path = "../sentry-backtrace" } -sentry-core = { version = "0.23.0", path = "../sentry-core" } +sentry-backtrace = { version = "0.24.1", path = "../sentry-backtrace" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } anyhow = "1.0.39" [dev-dependencies] diff --git a/sentry-anyhow/README.md b/sentry-anyhow/README.md index b013cbfb..fa52437d 100644 --- a/sentry-anyhow/README.md +++ b/sentry-anyhow/README.md @@ -1,4 +1,10 @@ -# sentry-anyhow +

+ + + +

+ +# Sentry Rust SDK: sentry-anyhow Adds support for capturing Sentry errors from [`anyhow::Error`]. @@ -36,11 +42,11 @@ if let Err(err) = function_that_might_fail() { The `backtrace` feature will enable the corresponding feature in anyhow and allow you to capture backtraces with your events. It is enabled by default. -## Resources - -- [Discord](https://discord.gg/ez5KZN7) server for project discussions. -- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates. - [`anyhow::Error`]: https://docs.rs/anyhow/*/anyhow/struct.Error.html +## Resources + License: Apache-2.0 + +- [Discord](https://discord.gg/ez5KZN7) server for project discussions. +- Follow [@getsentry](https://twitter.com/getsentry) on Twitter for updates diff --git a/sentry-backtrace/Cargo.toml b/sentry-backtrace/Cargo.toml index 6a548a6c..41f7ae98 100644 --- a/sentry-backtrace/Cargo.toml +++ b/sentry-backtrace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-backtrace" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,7 +12,7 @@ Sentry integration and utilities for dealing with stacktraces. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } lazy_static = "1.4.0" backtrace = "0.3.44" regex = "1.3.4" diff --git a/sentry-contexts/Cargo.toml b/sentry-contexts/Cargo.toml index 7b042139..03ff2a50 100644 --- a/sentry-contexts/Cargo.toml +++ b/sentry-contexts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-contexts" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -13,7 +13,7 @@ build = "build.rs" edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } libc = "0.2.66" hostname = "0.3.0" diff --git a/sentry-contexts/README.md b/sentry-contexts/README.md index c2d58763..d39c26df 100644 --- a/sentry-contexts/README.md +++ b/sentry-contexts/README.md @@ -6,10 +6,10 @@ # Sentry Rust SDK: sentry-contexts -Adds Contexts to Sentry Events +Adds Contexts to Sentry Events. This integration is enabled by default in `sentry` and adds `device`, `os` -and `rust` contexts to Events, as well as sets a `server_name` if not +and `rust` contexts to Events, and also sets a `server_name` if it is not already defined. See the [Contexts Interface] documentation for more info. diff --git a/sentry-core/Cargo.toml b/sentry-core/Cargo.toml index 71e997f7..74bf9deb 100644 --- a/sentry-core/Cargo.toml +++ b/sentry-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-core" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -27,7 +27,7 @@ debug-logs = ["log_"] test = ["client"] [dependencies] -sentry-types = { version = "0.23.0", path = "../sentry-types" } +sentry-types = { version = "0.24.1", path = "../sentry-types" } serde = { version = "1.0.104", features = ["derive"] } lazy_static = "1.4.0" rand = { version = "0.8.1", optional = true } diff --git a/sentry-core/README.md b/sentry-core/README.md index bec12a52..0dd7c8d7 100644 --- a/sentry-core/README.md +++ b/sentry-core/README.md @@ -6,14 +6,14 @@ # Sentry Rust SDK: sentry-core -This crate provides the core of the [Sentry](https://sentry.io/) SDK, which -can be used to log events and errors. +This crate provides the core of the [Sentry] SDK, which can be used to log +events and errors. -This crate is meant for integration authors and third party library authors +`sentry-core` is meant for integration authors and third-party library authors that want to instrument their code for sentry. Regular users who wish to integrate sentry into their applications should -rather use the [`sentry`] crate, which comes with a default transport, and +instead use the [`sentry`] crate, which comes with a default transport and a large set of integrations for various third-party libraries. ## Core Concepts @@ -34,24 +34,25 @@ functionality. ## Features -* `feature = "client"`: Activates the [`Client`] type and certain +- `feature = "client"`: Activates the [`Client`] type and certain [`Hub`] functionality. -* `feature = "test"`: Activates the [`test`] module, which can be used to +- `feature = "test"`: Activates the [`test`] module, which can be used to write integration tests. It comes with a test transport which can capture all sent events for inspection. -* `feature = "debug-logs"`: Uses the `log` crate for debug output, instead +- `feature = "debug-logs"`: Uses the `log` crate for debug output, instead of printing to `stderr`. This feature is **deprecated** and will be replaced by a dedicated log callback in the future. +[Sentry]: https://sentry.io/ [`sentry`]: https://crates.io/crates/sentry [Unified API]: https://develop.sentry.dev/sdk/unified-api/ -[`Client`]: https://docs.rs/sentry-core/0.21.0/sentry_core/struct.Client.html -[`Hub`]: https://docs.rs/sentry-core/0.21.0/sentry_core/struct.Hub.html -[`Scope`]: https://docs.rs/sentry-core/0.21.0/sentry_core/struct.Scope.html -[`Integration`]: https://docs.rs/sentry-core/0.21.0/sentry_core/trait.Integration.html -[`Transport`]: https://docs.rs/sentry-core/0.21.0/sentry_core/trait.Transport.html -[`TransportFactory`]: https://docs.rs/sentry-core/0.21.0/sentry_core/trait.TransportFactory.html -[`test`]: https://docs.rs/sentry-core/0.21.0/sentry_core/test/index.html +[`Client`]: https://docs.rs/sentry-core/0.24.1/sentry_core/struct.Client.html +[`Hub`]: https://docs.rs/sentry-core/0.24.1/sentry_core/struct.Hub.html +[`Scope`]: https://docs.rs/sentry-core/0.24.1/sentry_core/struct.Scope.html +[`Integration`]: https://docs.rs/sentry-core/0.24.1/sentry_core/trait.Integration.html +[`Transport`]: https://docs.rs/sentry-core/0.24.1/sentry_core/trait.Transport.html +[`TransportFactory`]: https://docs.rs/sentry-core/0.24.1/sentry_core/trait.TransportFactory.html +[`test`]: https://docs.rs/sentry-core/0.24.1/sentry_core/test/index.html ## Resources diff --git a/sentry-debug-images/Cargo.toml b/sentry-debug-images/Cargo.toml index 6848577a..5f374556 100644 --- a/sentry-debug-images/Cargo.toml +++ b/sentry-debug-images/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-debug-images" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,6 +12,6 @@ Sentry integration that adds the list of loaded libraries to events. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } lazy_static = "1.4.0" findshlibs = "=0.10.2" diff --git a/sentry-debug-images/README.md b/sentry-debug-images/README.md index c005176b..5385c268 100644 --- a/sentry-debug-images/README.md +++ b/sentry-debug-images/README.md @@ -6,12 +6,12 @@ # Sentry Rust SDK: sentry-debug-images -The Sentry Debug Images Integration. +The Sentry Debug Images integration. The [`DebugImagesIntegration`] adds metadata about the loaded shared libraries to Sentry [`Event`]s. -This Integration only works on Unix-like OSs right now. Support for Windows +This Integration only works on Unix-like OSes right now. Support for Windows will be added in the future. ## Configuration @@ -25,7 +25,7 @@ let integration = sentry_debug_images::DebugImagesIntegration::new() .filter(|event| event.level >= Level::Warning); ``` -[`Event`]: https://docs.rs/sentry-debug-images/0.21.0/sentry_debug-images/sentry_core::protocol::Event +[`Event`]: https://docs.rs/sentry-debug-images/0.24.1/sentry_debug-images/sentry_core::protocol::Event ## Resources diff --git a/sentry-log/Cargo.toml b/sentry-log/Cargo.toml index 59a8bbee..df4b5b20 100644 --- a/sentry-log/Cargo.toml +++ b/sentry-log/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-log" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,7 +12,7 @@ Sentry integration for log and env_logger crates. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } log = { version = "0.4.8", features = ["std"] } [dev-dependencies] diff --git a/sentry-log/README.md b/sentry-log/README.md index 25e804bc..dd462d75 100644 --- a/sentry-log/README.md +++ b/sentry-log/README.md @@ -10,7 +10,7 @@ Adds support for automatic Breadcrumb and Event capturing from logs. The `log` crate is supported in two ways. First, logs can be captured as breadcrumbs for later. Secondly, error logs can be captured as events to -Sentry. By default anything above `Info` is recorded as breadcrumb and +Sentry. By default anything above `Info` is recorded as a breadcrumb and anything above `Error` is captured as error event. ## Examples diff --git a/sentry-panic/Cargo.toml b/sentry-panic/Cargo.toml index f6baf4c0..838c684d 100644 --- a/sentry-panic/Cargo.toml +++ b/sentry-panic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-panic" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,8 +12,8 @@ Sentry integration for capturing panics. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core" } -sentry-backtrace = { version = "0.23.0", path = "../sentry-backtrace" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } +sentry-backtrace = { version = "0.24.1", path = "../sentry-backtrace" } [dev-dependencies] sentry = { path = "../sentry", default-features = false, features = ["test"] } diff --git a/sentry-panic/README.md b/sentry-panic/README.md index 83699687..2d28cf80 100644 --- a/sentry-panic/README.md +++ b/sentry-panic/README.md @@ -6,7 +6,7 @@ # Sentry Rust SDK: sentry-panic -The Sentry Panic handler Integration. +The Sentry Panic handler integration. The `PanicIntegration`, which is enabled by default in `sentry`, installs a panic handler that will automatically dispatch all errors to Sentry that diff --git a/sentry-slog/Cargo.toml b/sentry-slog/Cargo.toml index 39a599f6..2faba5a6 100644 --- a/sentry-slog/Cargo.toml +++ b/sentry-slog/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-slog" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,7 +12,7 @@ Sentry integration for the slog crate. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core" } +sentry-core = { version = "0.24.1", path = "../sentry-core" } slog = { version = "2.5.2", features = ["nested-values"] } serde_json = "1.0.46" diff --git a/sentry-slog/README.md b/sentry-slog/README.md index 6e4eecd4..22a307a2 100644 --- a/sentry-slog/README.md +++ b/sentry-slog/README.md @@ -12,35 +12,43 @@ This mainly provides the [`SentryDrain`], which wraps another [`slog::Drain`] and can be configured to forward [`slog::Record`]s to Sentry. The [`SentryDrain`] can be used to create a `slog::Logger`. -*NOTE*: This integration currently does not process any `slog::KV` pairs, -but support for this will be added in the future. +The integration also supports [`slog::KV`] pairs. They will be added to the +breadcrumb `data` or the event `extra` properties respectively. ## Examples ```rust -use sentry::{init, ClientOptions}; use sentry_slog::SentryDrain; let _sentry = sentry::init(()); let drain = SentryDrain::new(slog::Discard); -let root = slog::Logger::root(drain, slog::o!()); +let root = slog::Logger::root(drain, slog::o!("global_kv" => 1234)); -slog::info!(root, "recorded as breadcrumb"); -slog::warn!(root, "recorded as regular event"); +slog::info!(root, "recorded as breadcrumb"; "breadcrumb_kv" => Some("breadcrumb")); +slog::warn!(root, "recorded as regular event"; "event_kv" => "event"); +let breadcrumb = &captured_event.breadcrumbs.as_ref()[0]; assert_eq!( - captured_event.breadcrumbs.as_ref()[0].message.as_deref(), + breadcrumb.message.as_deref(), Some("recorded as breadcrumb") ); +assert_eq!(breadcrumb.data["breadcrumb_kv"], "breadcrumb"); +assert_eq!(breadcrumb.data["global_kv"], 1234); + assert_eq!( captured_event.message.as_deref(), Some("recorded as regular event") ); +assert_eq!(captured_event.extra["event_kv"], "event"); +assert_eq!(captured_event.extra["global_kv"], 1234); slog::crit!(root, "recorded as exception event"); -assert_eq!(captured_event.exception.len(), 1); +assert_eq!( + captured_event.message.as_deref(), + Some("recorded as exception event") +); ``` The Drain can also be customized with a `filter`, and a `mapper`: @@ -64,8 +72,6 @@ let drain = SentryDrain::new(slog::Discard) When a `mapper` is specified, a corresponding `filter` should also be provided. -[`SentryDrain`]: https://docs.rs/sentry-slog/0.21.0/sentry_slog/struct.SentryDrain.html - ## Resources License: Apache-2.0 diff --git a/sentry-tower/Cargo.toml b/sentry-tower/Cargo.toml index 733e0a6a..d4b27afb 100644 --- a/sentry-tower/Cargo.toml +++ b/sentry-tower/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-tower" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -19,7 +19,7 @@ tower-layer = "0.3" tower-service = "0.3" http_ = { package = "http", version = "0.2.6", optional = true } pin-project = { version = "1.0.10", optional = true } -sentry-core = { version = "0.23.0", path = "../sentry-core", default-features = false, features = ["client"] } +sentry-core = { version = "0.24.1", path = "../sentry-core", default-features = false, features = ["client"] } [dev-dependencies] anyhow = "1" diff --git a/sentry-tracing/Cargo.toml b/sentry-tracing/Cargo.toml index aa929313..a1079f89 100644 --- a/sentry-tracing/Cargo.toml +++ b/sentry-tracing/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-tracing" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -12,7 +12,7 @@ Sentry integration for tracing and tracing-subscriber crates. edition = "2018" [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core", features = ["client"] } +sentry-core = { version = "0.24.1", path = "../sentry-core", features = ["client"] } tracing-core = "0.1" tracing-subscriber = { version = "0.3.1", default-features = false, features = ["std"] } diff --git a/sentry-types/Cargo.toml b/sentry-types/Cargo.toml index badb88bb..4f228284 100644 --- a/sentry-types/Cargo.toml +++ b/sentry-types/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry-types" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" diff --git a/sentry/Cargo.toml b/sentry/Cargo.toml index 6ecf9b29..f2c67dcf 100644 --- a/sentry/Cargo.toml +++ b/sentry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "sentry" -version = "0.23.0" +version = "0.24.1" authors = ["Sentry "] license = "Apache-2.0" readme = "README.md" @@ -46,16 +46,16 @@ native-tls = ["reqwest_/default-tls"] rustls = ["reqwest_/rustls-tls"] [dependencies] -sentry-core = { version = "0.23.0", path = "../sentry-core", features = ["client"] } -sentry-anyhow = { version = "0.23.0", path = "../sentry-anyhow", optional = true } -sentry-backtrace = { version = "0.23.0", path = "../sentry-backtrace", optional = true } -sentry-contexts = { version = "0.23.0", path = "../sentry-contexts", optional = true } -sentry-debug-images = { version = "0.23.0", path = "../sentry-debug-images", optional = true } -sentry-log = { version = "0.23.0", path = "../sentry-log", optional = true } -sentry-panic = { version = "0.23.0", path = "../sentry-panic", optional = true } -sentry-slog = { version = "0.23.0", path = "../sentry-slog", optional = true } -sentry-tower = { version = "0.23.0", path = "../sentry-tower", optional = true } -sentry-tracing = { version = "0.23.0", path = "../sentry-tracing", optional = true } +sentry-core = { version = "0.24.1", path = "../sentry-core", features = ["client"] } +sentry-anyhow = { version = "0.24.1", path = "../sentry-anyhow", optional = true } +sentry-backtrace = { version = "0.24.1", path = "../sentry-backtrace", optional = true } +sentry-contexts = { version = "0.24.1", path = "../sentry-contexts", optional = true } +sentry-debug-images = { version = "0.24.1", path = "../sentry-debug-images", optional = true } +sentry-log = { version = "0.24.1", path = "../sentry-log", optional = true } +sentry-panic = { version = "0.24.1", path = "../sentry-panic", optional = true } +sentry-slog = { version = "0.24.1", path = "../sentry-slog", optional = true } +sentry-tower = { version = "0.24.1", path = "../sentry-tower", optional = true } +sentry-tracing = { version = "0.24.1", path = "../sentry-tracing", optional = true } log_ = { package = "log", version = "0.4.8", optional = true, features = ["std"] } reqwest_ = { package = "reqwest", version = "0.11", optional = true, features = ["blocking", "json"], default-features = false } curl_ = { package = "curl", version = "0.4.25", optional = true } diff --git a/sentry/README.md b/sentry/README.md index 0aa6f147..62ddf7bd 100644 --- a/sentry/README.md +++ b/sentry/README.md @@ -7,18 +7,20 @@ # Sentry Rust SDK: sentry This crate provides support for logging events and errors / panics to the -[Sentry](https://sentry.io/) error logging service. It integrates with the standard panic +[Sentry] error logging service. It integrates with the standard panic system in Rust as well as a few popular error handling setups. +[Sentry]: https://sentry.io/ + ## Quickstart -The most convenient way to use this library is the [`sentry::init`] function, +The most convenient way to use this library is via the [`sentry::init`] function, which starts a sentry client with a default set of integrations, and binds it to the current [`Hub`]. The [`sentry::init`] function returns a guard that when dropped will flush Events that were not -yet sent to the sentry service. It has a two second deadline for this so shutdown of -applications might slightly delay as a result of this. Keep the guard around or sending events +yet sent to the sentry service. It has a two second deadline for this so shutdown of +applications might slightly delay as a result of this. Keep the guard around or sending events will not work. ```rust @@ -28,57 +30,90 @@ sentry::capture_message("Hello World!", sentry::Level::Info); // seconds to send remaining events to the service. ``` -[`sentry::init`]: https://docs.rs/sentry/0.21.0/sentry/fn.init.html -[`Hub`]: https://docs.rs/sentry/0.21.0/sentry/struct.Hub.html +More complex examples on how to use sentry can also be found in [examples]. Extended instructions +may also be found on [Sentry itself]. + +[`sentry::init`]: https://docs.rs/sentry/0.24.1/sentry/fn.init.html +[`Hub`]: https://docs.rs/sentry/0.24.1/sentry/struct.Hub.html +[examples]: https://github.com/getsentry/sentry-rust/tree/master/sentry/examples +[Sentry itself]: https://docs.sentry.io/platforms/rust ## Integrations -What makes this crate useful are the various integrations that exist. Some of them are enabled -by default, some uncommon ones or for deprecated parts of the ecosystem a feature flag needs to -be enabled. For the available integrations and how to use them see -[integrations](https://docs.rs/sentry/0.21.0/sentry/integrations/index.html) and [apply_defaults](https://docs.rs/sentry/0.21.0/sentry/fn.apply_defaults.html). +What makes this crate useful are its various integrations. Some of them are enabled by +default; See [Features]. Uncommon integrations or integrations for deprecated parts of +the ecosystem require a feature flag. For available integrations and how to use them, see +[integrations] and [apply_defaults]. + +[Features]: #features +[integrations]: https://docs.rs/sentry/0.24.1/sentry/integrations/index.html +[apply_defaults]: https://docs.rs/sentry/0.24.1/sentry/fn.apply_defaults.html ## Minimal API -This crate comes fully featured. If the goal is to instrument libraries for usage +This crate comes fully-featured. If the goal is to instrument libraries for usage with sentry, or to extend sentry with a custom [`Integration`] or a [`Transport`], one should use the [`sentry-core`] crate instead. -[`Integration`]: https://docs.rs/sentry/0.21.0/sentry/trait.Integration.html -[`Transport`]: https://docs.rs/sentry/0.21.0/sentry/trait.Transport.html +[`Integration`]: https://docs.rs/sentry/0.24.1/sentry/trait.Integration.html +[`Transport`]: https://docs.rs/sentry/0.24.1/sentry/trait.Transport.html [`sentry-core`]: https://crates.io/crates/sentry-core ## Features -Functionality of the crate can be turned on and off by feature flags. This is the current list -of feature flags: - -Default features: - -* `backtrace`: Enables backtrace support. -* `contexts`: Enables capturing device, os, and rust contexts. -* `panic`: Enables support for capturing panics. -* `transport`: Enables the default transport, which is currently `reqwest` with `native-tls`. - -Additional features: - -* `anyhow`: Enables support for the `anyhow` crate. -* `debug-images`: Attaches a list of loaded libraries to events (currently only supported on unix). -* `error-chain`: Enables support for the `error-chain` crate. -* `failure`: Enables support for the `failure` crate. -* `log`: Enables support for the `log` crate. -* `env_logger`: Enables support for the `log` crate with additional `env_logger` support. -* `slog`: Enables support for the `slog` crate. -* `test`: Enables testing support. -* `debug-logs`: Uses the `log` crate for internal logging. -* `reqwest`: Enables the `reqwest` transport, which is currently the default. -* `curl`: Enables the curl transport. -* `surf`: Enables the surf transport. -* `native-tls`: Uses the `native-tls` crate, which is currently the default. - This only has an effect on the `reqwest` transport. -* `rustls`: Enables the `rustls` support of the `reqwest` transport. - Please note that `native-tls` is a default feature, and one needs to use - `default-features = false` to completely disable building `native-tls` dependencies. +Additional functionality and integrations are enabled via feature flags. Some features require +extra setup to function properly. + +| Feature | Default | Is Integration | Deprecated | Additional notes | +| -------------- | ------- | -------------- | ---------- | ---------------------------------------------------------------------------------------- | +| `backtrace` | ✅ | 🔌 | | | +| `contexts` | ✅ | 🔌 | | | +| `panic` | ✅ | 🔌 | | | +| `transport` | ✅ | | | | +| `anyhow` | | 🔌 | | | +| `test` | | | | | +| `debug-images` | | 🔌 | | | +| `log` | | 🔌 | | Requires extra setup; See [`sentry-log`]'s documentation. | +| `debug-logs` | | | ❗ | Requires extra setup; See [`sentry-log`]'s documentation. | +| `slog` | | 🔌 | | Requires extra setup; See [`sentry-slog`]'s documentation. | +| `reqwest` | ✅ | | | | +| `native-tls` | ✅ | | | `reqwest` must be enabled. | +| `rustls` | | | | `reqwest` must be enabled. `native-tls` must be disabled via `default-features = false`. | +| `curl` | | | | | +| `surf` | | | | | +| `tower` | | 🔌 | | Requires extra setup; See [`sentry-tower`]'s documentation. | + +[`sentry-log`]: https://crates.io/crates/sentry-log +[`sentry-slog`]: https://crates.io/crates/sentry-slog +[`sentry-tower`]: https://crates.io/crates/sentry-tower + +### Default features +- `backtrace`: Enables backtrace support. +- `contexts`: Enables capturing device, OS, and Rust contexts. +- `panic`: Enables support for capturing panics. +- `transport`: Enables the default transport, which is currently `reqwest` with `native-tls`. + +### Debugging/Testing +- `anyhow`: Enables support for the `anyhow` crate. +- `test`: Enables testing support. +- `debug-images`: Attaches a list of loaded libraries to events (currently only supported on Unix). + +### Logging +- `log`: Enables support for the `log` crate. +- `slog`: Enables support for the `slog` crate. +- `debug-logs`: **Deprecated**. Uses the `log` crate for internal logging. + +### Transports +- `reqwest`: **Default**. Enables the `reqwest` transport. +- `native-tls`: **Default**. Uses the `native-tls` crate. This only affects the `reqwest` transport. +- `rustls`: Enables `rustls` support for `reqwest`. Please note that `native-tls` is a default + feature, and `default-features = false` must be set to completely disable building `native-tls` + dependencies. +- `curl`: Enables the curl transport. +- `surf`: Enables the surf transport. + +### Integrations +- `tower`: Enables support for the `tower` crate and those using it. ## Resources