pub struct DynamicSamplingContext { /* private fields */ }
Expand description
Sentry supports sampling at the server level through Dynamic Sampling. This feature allows users to specify target sample rates for each project via the frontend instead of requiring an application redeployment. The backend needs additional information from the SDK to support these features, contained in the Dynamic Sampling Context.
Implementations§
Source§impl DynamicSamplingContext
impl DynamicSamplingContext
Sourcepub fn new() -> DynamicSamplingContext
pub fn new() -> DynamicSamplingContext
Creates an empty Dynamic Sampling Context.
Sourcepub fn with_trace_id(self, trace_id: TraceId) -> DynamicSamplingContext
pub fn with_trace_id(self, trace_id: TraceId) -> DynamicSamplingContext
Sets the trace ID.
Sourcepub fn with_public_key(self, public_key: String) -> DynamicSamplingContext
pub fn with_public_key(self, public_key: String) -> DynamicSamplingContext
Sets the DSN public key.
Sourcepub fn with_sample_rate(self, sample_rate: f32) -> DynamicSamplingContext
pub fn with_sample_rate(self, sample_rate: f32) -> DynamicSamplingContext
Sets the sample rate.
Sourcepub fn with_sample_rand(self, sample_rand: SampleRand) -> DynamicSamplingContext
pub fn with_sample_rand(self, sample_rand: SampleRand) -> DynamicSamplingContext
Sets the sample random value generated by the head of trace SDK.
Sourcepub fn with_sampled(self, sampled: bool) -> DynamicSamplingContext
pub fn with_sampled(self, sampled: bool) -> DynamicSamplingContext
Sets the sampled flag.
Sourcepub fn with_release(self, release: String) -> DynamicSamplingContext
pub fn with_release(self, release: String) -> DynamicSamplingContext
Sets the release.
Sourcepub fn with_environment(self, environment: String) -> DynamicSamplingContext
pub fn with_environment(self, environment: String) -> DynamicSamplingContext
Sets the environment.
Sourcepub fn with_transaction(self, transaction: String) -> DynamicSamplingContext
pub fn with_transaction(self, transaction: String) -> DynamicSamplingContext
Sets the transaction.
Sourcepub fn with_org_id(self, org_id: OrganizationId) -> DynamicSamplingContext
pub fn with_org_id(self, org_id: OrganizationId) -> DynamicSamplingContext
Sets the organization ID.
Trait Implementations§
Source§impl Clone for DynamicSamplingContext
impl Clone for DynamicSamplingContext
Source§fn clone(&self) -> DynamicSamplingContext
fn clone(&self) -> DynamicSamplingContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for DynamicSamplingContext
impl Debug for DynamicSamplingContext
Source§impl Default for DynamicSamplingContext
impl Default for DynamicSamplingContext
Source§fn default() -> DynamicSamplingContext
fn default() -> DynamicSamplingContext
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for DynamicSamplingContext
impl<'de> Deserialize<'de> for DynamicSamplingContext
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<DynamicSamplingContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<DynamicSamplingContext, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for DynamicSamplingContext
impl PartialEq for DynamicSamplingContext
Source§impl Serialize for DynamicSamplingContext
impl Serialize for DynamicSamplingContext
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for DynamicSamplingContext
Auto Trait Implementations§
impl Freeze for DynamicSamplingContext
impl RefUnwindSafe for DynamicSamplingContext
impl Send for DynamicSamplingContext
impl Sync for DynamicSamplingContext
impl Unpin for DynamicSamplingContext
impl UnwindSafe for DynamicSamplingContext
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
Mutably borrows from an owned value. Read more