pub struct Sentry {
pub dsn: Option<SecretBox<ConfigSecret>>,
pub environment: Option<Cow<'static, str>>,
pub server_name: Option<Cow<'static, str>>,
pub sample_rate: f32,
pub traces_sample_rate: f32,
pub inherit_sampling_decision: bool,
pub debug: bool,
}Expand description
Sentry error tracking and performance monitoring configuration.
Configures integration with Sentry for error tracking, performance monitoring, and distributed tracing. Sentry is disabled by default and only enabled when a DSN is provided.
Used in: Config::sentry
Fields§
§dsn: Option<SecretBox<ConfigSecret>>Sentry DSN (Data Source Name).
When set, enables Sentry error tracking and performance monitoring. When None, Sentry
integration is completely disabled.
§Default
None (Sentry disabled)
§Environment Variable
OS__SENTRY__DSN
environment: Option<Cow<'static, str>>Environment name for this deployment.
Used to distinguish events from different environments (e.g., “production”, “staging”, “development”). This appears in the Sentry UI and can be used for filtering.
§Default
None
§Environment Variable
OS__SENTRY__ENVIRONMENT
server_name: Option<Cow<'static, str>>Server name or identifier.
Used to identify which server instance sent an event. Useful in multi-server deployments for tracking which instance encountered an error. Set to the hostname or pod name of the server.
§Default
None
§Environment Variable
OS__SENTRY__SERVER_NAME
sample_rate: f32Error event sampling rate.
Controls what percentage of error events are sent to Sentry. A value of 1.0 sends all
errors, while 0.5 sends 50% of errors, and 0.0 sends no errors.
§Default
1.0 (send all errors)
§Environment Variable
OS__SENTRY__SAMPLE_RATE
traces_sample_rate: f32Performance trace sampling rate.
Controls what percentage of transactions (traces) are sent to Sentry for performance
monitoring. A value of 1.0 sends all traces, while 0.01 sends 1% of traces.
Important: Performance traces can generate significant data volume in high-traffic systems. Start with a low rate (0.01-0.1) and adjust based on traffic and Sentry quota.
§Default
0.01 (send 1% of traces)
§Environment Variable
OS__SENTRY__TRACES_SAMPLE_RATE
inherit_sampling_decision: boolWhether to inherit sampling decisions from incoming traces.
When true (default), if an incoming request contains a distributed tracing header with a
sampling decision (e.g., from an upstream service), that decision is honored. When false,
the local traces_sample_rate is always used instead.
When this is enabled, the calling service effectively controls the sampling decision for the
entire trace. Set this to false if you want to have independent sampling control at the
objectstore level.
§Default
true
§Environment Variable
OS__SENTRY__INHERIT_SAMPLING_DECISION
debug: boolEnable Sentry SDK debug mode.
When enabled, the Sentry SDK will output debug information to stderr, which can be useful for troubleshooting Sentry integration issues. It is discouraged to enable this in production as it generates verbose logging.
§Default
false
§Environment Variable
OS__SENTRY__DEBUG
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sentry
impl<'de> Deserialize<'de> for Sentry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for Sentry
impl RefUnwindSafe for Sentry
impl Send for Sentry
impl Sync for Sentry
impl Unpin for Sentry
impl UnwindSafe for Sentry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);