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.

§tags: Vec<TagMapping>

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.

§_conditional_tags_extended: bool

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

source

pub const MAX_SUPPORTED_VERSION: u16 = 3u16

The latest version for this config struct.

This is the maximum version supported by this Relay instance.

source

pub fn empty() -> Self

Returns an empty MetricExtractionConfig with the latest version.

As opposed to default(), this will be enabled once populated with specs.

source

pub fn is_supported(&self) -> bool

Returns true if the version of this metric extraction config is supported.

source

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

source§

fn clone(&self) -> MetricExtractionConfig

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MetricExtractionConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for MetricExtractionConfig

source§

fn default() -> MetricExtractionConfig

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for MetricExtractionConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<'a> From<&'a MetricExtractionConfig> for CombinedMetricExtractionConfig<'a>

source§

fn from(value: &'a MetricExtractionConfig) -> Self

Creates a combined config with an empty global component. Used in tests.

source§

impl Serialize for MetricExtractionConfig

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<Ok, Error>

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,