pub struct ClientOptions {Show 23 fields
pub dsn: Option<Dsn>,
pub debug: bool,
pub release: Option<Cow<'static, str>>,
pub environment: Option<Cow<'static, str>>,
pub sample_rate: f32,
pub max_breadcrumbs: usize,
pub attach_stacktrace: bool,
pub send_default_pii: bool,
pub server_name: Option<Cow<'static, str>>,
pub in_app_include: Vec<&'static str>,
pub in_app_exclude: Vec<&'static str>,
pub integrations: Vec<Arc<dyn Integration>>,
pub default_integrations: bool,
pub before_send: Option<Arc<dyn Fn(Event<'static>) -> Option<Event<'static>> + Sync + Send>>,
pub before_breadcrumb: Option<Arc<dyn Fn(Breadcrumb) -> Option<Breadcrumb> + Sync + Send>>,
pub transport: Option<Arc<dyn TransportFactory>>,
pub http_proxy: Option<Cow<'static, str>>,
pub https_proxy: Option<Cow<'static, str>>,
pub shutdown_timeout: Duration,
pub auto_session_tracking: bool,
pub extra_border_frames: Vec<&'static str>,
pub trim_backtraces: bool,
pub user_agent: Cow<'static, str>,
}
Expand description
Configuration settings for the client.
These options are explained in more detail in the general sentry documentation.
§Examples
let _options = sentry::ClientOptions {
debug: true,
..Default::default()
};
Fields§
§dsn: Option<Dsn>
The DSN to use. If not set the client is effectively disabled.
debug: bool
Enables debug mode.
In debug mode debug information is printed to stderr to help you understand what
sentry is doing. When the log
feature is enabled, Sentry will instead
log to the sentry
logger independently of this flag with the Debug
level.
release: Option<Cow<'static, str>>
The release to be sent with events.
environment: Option<Cow<'static, str>>
The environment to be sent with events.
Defaults to either "development"
or "production"
depending on the
debug_assertions
cfg-attribute.
sample_rate: f32
The sample rate for event submission. (0.0 - 1.0, defaults to 1.0)
Maximum number of breadcrumbs. (defaults to 100)
attach_stacktrace: bool
Attaches stacktraces to messages.
send_default_pii: bool
If turned on some default PII informat is attached.
server_name: Option<Cow<'static, str>>
The server name to be reported.
in_app_include: Vec<&'static str>
Module prefixes that are always considered “in_app”.
in_app_exclude: Vec<&'static str>
Module prefixes that are never “in_app”.
integrations: Vec<Arc<dyn Integration>>
A list of integrations to enable.
default_integrations: bool
Whether to add default integrations.
before_send: Option<Arc<dyn Fn(Event<'static>) -> Option<Event<'static>> + Sync + Send>>
Callback that is executed before event sending.
Callback that is executed for each Breadcrumb being added.
transport: Option<Arc<dyn TransportFactory>>
The transport to use.
This is typically either a boxed function taking the client options by
reference and returning a Transport
, a boxed Arc<Transport>
or
alternatively the DefaultTransportFactory
.
http_proxy: Option<Cow<'static, str>>
An optional HTTP proxy to use.
This will default to the http_proxy
environment variable.
https_proxy: Option<Cow<'static, str>>
An optional HTTPS proxy to use.
This will default to the HTTPS_PROXY
environment variable
or http_proxy
if that one exists.
shutdown_timeout: Duration
The timeout on client drop for draining events on shutdown.
auto_session_tracking: bool
Enable Release Health Session tracking.
When automatic session tracking is enabled, a new “user-mode” session
is started at the time of sentry::init
, and will persist for the
application lifetime.
extra_border_frames: Vec<&'static str>
Border frames which indicate a border from a backtrace to useless internals. Some are automatically included.
trim_backtraces: bool
Automatically trim backtraces of junk before sending. (defaults to true)
user_agent: Cow<'static, str>
The user agent that should be reported.
Implementations§
Source§impl ClientOptions
impl ClientOptions
Sourcepub fn new() -> ClientOptions
pub fn new() -> ClientOptions
Creates new Options.
Sourcepub fn add_integration<I>(self, integration: I) -> ClientOptionswhere
I: Integration,
pub fn add_integration<I>(self, integration: I) -> ClientOptionswhere
I: Integration,
Adds a configured integration to the options.
§Examples
struct MyIntegration;
impl sentry::Integration for MyIntegration {}
let options = sentry::ClientOptions::new().add_integration(MyIntegration);
assert_eq!(options.integrations.len(), 1);
Trait Implementations§
Source§impl Clone for ClientOptions
impl Clone for ClientOptions
Source§fn clone(&self) -> ClientOptions
fn clone(&self) -> ClientOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ClientOptions
impl Debug for ClientOptions
Source§impl Default for ClientOptions
impl Default for ClientOptions
Source§fn default() -> ClientOptions
fn default() -> ClientOptions
Source§impl<T> From<(T, ClientOptions)> for ClientOptionswhere
T: IntoDsn,
impl<T> From<(T, ClientOptions)> for ClientOptionswhere
T: IntoDsn,
Source§fn from(_: (T, ClientOptions)) -> ClientOptions
fn from(_: (T, ClientOptions)) -> ClientOptions
Source§impl<T> From<T> for ClientOptionswhere
T: IntoDsn,
impl<T> From<T> for ClientOptionswhere
T: IntoDsn,
Source§fn from(into_dsn: T) -> ClientOptions
fn from(into_dsn: T) -> ClientOptions
Auto Trait Implementations§
impl Freeze for ClientOptions
impl !RefUnwindSafe for ClientOptions
impl Send for ClientOptions
impl Sync for ClientOptions
impl Unpin for ClientOptions
impl !UnwindSafe for ClientOptions
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more