Struct relay_sampling::config::SamplingConfig
source · pub struct SamplingConfig {
pub version: u16,
pub rules: Vec<SamplingRule>,
pub rules_v2: Vec<SamplingRule>,
}
Expand description
Represents the dynamic sampling configuration available to a project.
Note: This comes from the organization data
Fields§
§version: u16
The required version to run dynamic sampling.
Defaults to legacy version (1
) when missing.
rules: Vec<SamplingRule>
The ordered sampling rules for the project.
rules_v2: Vec<SamplingRule>
Deprecated. The ordered sampling rules for the project in legacy format.
Removed in favor of Self::rules
in version 2
. This field remains here to parse rules
from old Sentry instances and convert them into the new format. The legacy format contained
both an empty rules
as well as the actual rules in rules_v2
. During normalization, these
two arrays are merged together.
Implementations§
source§impl SamplingConfig
impl SamplingConfig
sourcepub fn new() -> Self
pub fn new() -> Self
Creates an enabled configuration with empty defaults and the latest version.
sourcepub fn unsupported(&self) -> bool
pub fn unsupported(&self) -> bool
Returns true
if any of the rules in this configuration is unsupported.
sourcepub fn filter_rules(
&self,
rule_type: RuleType,
) -> impl Iterator<Item = &SamplingRule>
pub fn filter_rules( &self, rule_type: RuleType, ) -> impl Iterator<Item = &SamplingRule>
Filters the sampling rules by the given RuleType
.
Trait Implementations§
source§impl Clone for SamplingConfig
impl Clone for SamplingConfig
source§fn clone(&self) -> SamplingConfig
fn clone(&self) -> SamplingConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for SamplingConfig
impl Debug for SamplingConfig
source§impl Default for SamplingConfig
impl Default for SamplingConfig
source§impl<'de> Deserialize<'de> for SamplingConfig
impl<'de> Deserialize<'de> for SamplingConfig
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 SamplingConfig
impl RefUnwindSafe for SamplingConfig
impl Send for SamplingConfig
impl Sync for SamplingConfig
impl Unpin for SamplingConfig
impl UnwindSafe for SamplingConfig
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)