pub struct SentryConfig { /* private fields */ }Expand description
Represents the application-level configuration section that covers everything related to Sentry integration.
This config comes with a custom Deserialize implementation, to support more
human-oriented textual configuration.
Implementations§
Source§impl SentryConfig
impl SentryConfig
Sourcepub fn dsn(&self) -> &SecureString
pub fn dsn(&self) -> &SecureString
Returns the Sentry DSN (Data Source Name), which acts like a connection string. This value tells the app where to send error reports.
Sourcepub fn debug(&self) -> bool
pub fn debug(&self) -> bool
Indicates whether Sentry debug mode is enabled.
When true, the Sentry client will log internal operations (e.g., failed
event deliveries). Useful during development or troubleshooting.
Sourcepub fn sample_rate(&self) -> f32
pub fn sample_rate(&self) -> f32
Returns the sample rate for error event reporting (0.0 to 1.0).
For example, a value of 1.0 means all errors will be reported; 0.5 means only half (randomly selected). Helps control how much data is sent.
Sourcepub fn traces_sample_rate(&self) -> f32
pub fn traces_sample_rate(&self) -> f32
Returns the traces sample rate (0.0 to 1.0), which controls performance tracing.
This affects how often spans and transaction traces are sent to Sentry. Higher values give more observability but can increase overhead.
Returns the maximum number of breadcrumbs (context logs) stored per event.
Breadcrumbs are small logs (like “user clicked button”) that help reconstruct what happened before an error. This setting limits how many of those are retained.
Sourcepub fn attach_stacktrace(&self) -> bool
pub fn attach_stacktrace(&self) -> bool
Indicates whether stack traces should be automatically attached to events.
When true, errors and certain logs will include call stacks to help
identify where they originated. This improves debugging but adds overhead.
Sourcepub fn shutdown_timeout(&self) -> Duration
pub fn shutdown_timeout(&self) -> Duration
Returns the maximum time allowed to send any remaining events before shutdown.
On application exit, Sentry will attempt to flush queued events. This timeout defines how long it should wait before giving up.
Trait Implementations§
Source§impl AsRef<SentryConfig> for SentryConfig
impl AsRef<SentryConfig> for SentryConfig
Source§fn as_ref(&self) -> &SentryConfig
fn as_ref(&self) -> &SentryConfig
Source§impl Clone for SentryConfig
impl Clone for SentryConfig
Source§fn clone(&self) -> SentryConfig
fn clone(&self) -> SentryConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more