pub struct MetricExtractionConfig {
pub version: u16,
pub global_groups: BTreeMap<String, MetricExtractionGroupOverride>,
pub metrics: Vec<MetricSpec>,
pub tags: Vec<TagMapping>,
pub _conditional_tags_extended: bool,
pub _span_metrics_extended: bool,
}
Expand description
Configuration for generic extraction of metrics from all data categories.
Fields§
§version: u16
Versioning of metrics extraction. Relay skips extraction if the version is not supported.
global_groups: BTreeMap<String, MetricExtractionGroupOverride>
Configuration of global metric groups.
The groups themselves are configured in crate::GlobalConfig
,
but can be enabled or disabled here.
metrics: Vec<MetricSpec>
A list of metric specifications to extract.
A list of tags to add to previously extracted metrics.
These tags add further tags to a range of metrics. If some metrics already have a matching tag extracted, the existing tag is left unchanged.
This config has been extended with fields from conditional_tagging
.
At the moment, Relay will parse conditional_tagging
rules and insert them into the tags
mapping in this struct. If the flag is true
, this has already happened and should not be
repeated.
This is a temporary flag that will be removed once the transaction metric extraction version
is bumped to 2
.
_span_metrics_extended: bool
This config has been extended with default span metrics.
Relay checks for the span extraction flag and adds built-in metrics and tags to this struct.
If the flag is true
, this has already happened and should not be repeated.
This is a temporary flag that will be removed once the transaction metric extraction version
is bumped to 2
.
Implementations§
source§impl MetricExtractionConfig
impl MetricExtractionConfig
sourcepub const MAX_SUPPORTED_VERSION: u16 = 3u16
pub const MAX_SUPPORTED_VERSION: u16 = 3u16
The latest version for this config struct.
This is the maximum version supported by this Relay instance.
sourcepub fn empty() -> Self
pub fn empty() -> Self
Returns an empty MetricExtractionConfig
with the latest version.
As opposed to default()
, this will be enabled once populated with specs.
sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Returns true
if the version of this metric extraction config is supported.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns true
if metric extraction is configured and compatible with this Relay.
Trait Implementations§
source§impl Clone for MetricExtractionConfig
impl Clone for MetricExtractionConfig
source§fn clone(&self) -> MetricExtractionConfig
fn clone(&self) -> MetricExtractionConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetricExtractionConfig
impl Debug for MetricExtractionConfig
source§impl Default for MetricExtractionConfig
impl Default for MetricExtractionConfig
source§fn default() -> MetricExtractionConfig
fn default() -> MetricExtractionConfig
source§impl<'de> Deserialize<'de> for MetricExtractionConfig
impl<'de> Deserialize<'de> for MetricExtractionConfig
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>,
source§impl<'a> From<&'a MetricExtractionConfig> for CombinedMetricExtractionConfig<'a>
impl<'a> From<&'a MetricExtractionConfig> for CombinedMetricExtractionConfig<'a>
source§fn from(value: &'a MetricExtractionConfig) -> Self
fn from(value: &'a MetricExtractionConfig) -> Self
Creates a combined config with an empty global component. Used in tests.