pub enum MetricNamespace {
Sessions,
Transactions,
Spans,
Profiles,
Custom,
Stats,
Unsupported,
}
Expand description
The namespace of a metric.
Namespaces allow to identify the product entity that the metric got extracted from, and identify the use case that the metric belongs to. These namespaces cannot be defined freely, instead they are defined by Sentry. Over time, there will be more namespaces as we introduce new metrics-based functionality.
§Parsing
Parsing a metric namespace from strings is infallible. Unknown strings are mapped to
MetricNamespace::Unsupported
. Metrics with such a namespace will be dropped.
§Ingestion
During ingestion, the metric namespace is validated against a list of known and enabled namespaces. Metrics in disabled namespaces are dropped during ingestion.
At a later stage, namespaces are used to route metrics to their associated infra structure and enforce usecase-specific configuration.
Variants§
Sessions
Metrics extracted from sessions.
Transactions
Metrics extracted from transaction events.
Spans
Metrics extracted from spans.
Profiles
Metrics extracted from profile functions.
Custom
User-defined metrics directly sent by SDKs and applications.
Stats
Metric stats.
Metrics about metrics.
Unsupported
An unknown and unsupported metric.
Metrics that Relay either doesn’t know or recognize the namespace of will be dropped before
aggregating. For instance, an MRI of c:something_new/foo@none
has the namespace
something_new
, but as Relay doesn’t support that namespace, it gets deserialized into
this variant.
Relay currently drops all metrics whose namespace ends up being deserialized as
unsupported
. We may revise that in the future.
Implementations§
source§impl MetricNamespace
impl MetricNamespace
sourcepub fn all() -> [MetricNamespace; 7]
pub fn all() -> [MetricNamespace; 7]
Returns all namespaces/variants of this enum.
sourcepub fn has_metric_stats(&self) -> bool
pub fn has_metric_stats(&self) -> bool
Returns true
if metric stats are enabled for this namespace.
Trait Implementations§
source§impl Clone for MetricNamespace
impl Clone for MetricNamespace
source§fn clone(&self) -> MetricNamespace
fn clone(&self) -> MetricNamespace
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for MetricNamespace
impl Debug for MetricNamespace
source§impl<'de> Deserialize<'de> for MetricNamespace
impl<'de> Deserialize<'de> for MetricNamespace
source§fn deserialize<D>(
deserializer: D,
) -> Result<MetricNamespace, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MetricNamespace, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
source§impl Display for MetricNamespace
impl Display for MetricNamespace
source§impl FromStr for MetricNamespace
impl FromStr for MetricNamespace
source§type Err = ParseMetricError
type Err = ParseMetricError
source§fn from_str(
ns: &str,
) -> Result<MetricNamespace, <MetricNamespace as FromStr>::Err>
fn from_str( ns: &str, ) -> Result<MetricNamespace, <MetricNamespace as FromStr>::Err>
s
to return a value of this type. Read moresource§impl Hash for MetricNamespace
impl Hash for MetricNamespace
source§impl Ord for MetricNamespace
impl Ord for MetricNamespace
source§fn cmp(&self, other: &MetricNamespace) -> Ordering
fn cmp(&self, other: &MetricNamespace) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for MetricNamespace
impl PartialEq for MetricNamespace
source§impl PartialOrd for MetricNamespace
impl PartialOrd for MetricNamespace
source§impl Serialize for MetricNamespace
impl Serialize for MetricNamespace
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,
impl Copy for MetricNamespace
impl Eq for MetricNamespace
impl StructuralPartialEq for MetricNamespace
Auto Trait Implementations§
impl Freeze for MetricNamespace
impl RefUnwindSafe for MetricNamespace
impl Send for MetricNamespace
impl Sync for MetricNamespace
impl Unpin for MetricNamespace
impl UnwindSafe for MetricNamespace
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
)§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.