Struct relay_dynamic_config::MetricSpec
source · pub struct MetricSpec {
pub category: DataCategory,
pub mri: String,
pub field: Option<String>,
pub condition: Option<RuleCondition>,
pub tags: Vec<TagSpec>,
}
Expand description
Specification for a metric to extract from some data.
Fields§
§category: DataCategory
Category of data to extract this metric for.
mri: String
The Metric Resource Identifier (MRI) of the metric to extract.
field: Option<String>
A path to the field to extract the metric from.
This value contains a fully qualified expression pointing at the data field in the payload
to extract the metric from. It follows the Getter
syntax that is also used for dynamic
sampling.
How the value is treated depends on the metric type:
- Counter metrics are a special case, since the default product counters do not count
any specific field but rather the occurrence of the event. As such, there is no value
expression, and the field is set to
None
. Semantics of specifying remain undefined at this point. - Distribution metrics require a numeric value. If the value at the specified path is not numeric, metric extraction will be skipped.
- Set metrics require a string value, which is then emitted into the set as unique value. Insertion of numbers and other types is undefined.
If the field does not exist, extraction is skipped.
condition: Option<RuleCondition>
An optional condition to meet before extraction.
See RuleCondition
for all available options to specify and combine conditions. If no
condition is specified, the metric is extracted unconditionally.
A list of tags to add to the metric.
Tags can be conditional, see TagSpec
for configuration options. For this reason, it is
possible to list tag keys multiple times, each with different conditions. The first matching
condition will be applied.
Trait Implementations§
source§impl Clone for MetricSpec
impl Clone for MetricSpec
source§fn clone(&self) -> MetricSpec
fn clone(&self) -> MetricSpec
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetricSpec
impl Debug for MetricSpec
source§impl<'de> Deserialize<'de> for MetricSpec
impl<'de> Deserialize<'de> for MetricSpec
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 MetricSpec
impl RefUnwindSafe for MetricSpec
impl Send for MetricSpec
impl Sync for MetricSpec
impl Unpin for MetricSpec
impl UnwindSafe for MetricSpec
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
)