pub struct RawOrigin<'a> { /* private fields */ }
Expand description
A raw representation of an origin.
Metrics contain metadata about their origin, in terms of the metric’s reason for existing: the metric was ingested via DogStatsD, or was generated by an integration, and so on. However, there is also the concept of a metric originating from a particular entity, such as a specific Kubernetes container. This relates directly to the specific sender of the metric, which is used to enrich the metric with additional tags describing the origin entity.
The origin entity will generally be the process ID of the metric sender, or the container ID, both of which are then generally mapped to the relevant information for the metric, such as the orchestrator-level tags for the container/pod/deployment.
Implementations§
Source§impl<'a> RawOrigin<'a>
impl<'a> RawOrigin<'a>
Sourcepub fn clear_process_id(&mut self)
pub fn clear_process_id(&mut self)
Unsets the process ID of the sender.
Sourcepub fn set_process_id(&mut self, process_id: u32)
pub fn set_process_id(&mut self, process_id: u32)
Sets the process ID of the sender.
Must be a non-zero value. If the value is zero, it is silently ignored.
Sourcepub fn process_id(&self) -> Option<u32>
pub fn process_id(&self) -> Option<u32>
Returns the process ID of the sender.
Sourcepub fn set_container_id(&mut self, container_id: impl Into<Option<&'a str>>)
pub fn set_container_id(&mut self, container_id: impl Into<Option<&'a str>>)
Sets the container ID of the sender.
Sourcepub fn container_id(&self) -> Option<&str>
pub fn container_id(&self) -> Option<&str>
Returns the container ID of the sender.
Sourcepub fn set_pod_uid(&mut self, pod_uid: impl Into<Option<&'a str>>)
pub fn set_pod_uid(&mut self, pod_uid: impl Into<Option<&'a str>>)
Sets the pod UID of the sender.
Sourcepub fn set_cardinality(
&mut self,
cardinality: impl Into<Option<OriginTagCardinality>>,
)
pub fn set_cardinality( &mut self, cardinality: impl Into<Option<OriginTagCardinality>>, )
Sets the desired cardinality of any tags associated with the entity.
Sourcepub fn cardinality(&self) -> Option<OriginTagCardinality>
pub fn cardinality(&self) -> Option<OriginTagCardinality>
Returns the desired cardinality of any tags associated with the entity.
Sourcepub fn set_external_data(&mut self, external_data: impl Into<Option<&'a str>>)
pub fn set_external_data(&mut self, external_data: impl Into<Option<&'a str>>)
Sets the external data of the sender.
Sourcepub fn external_data(&self) -> Option<&RawExternalData<'a>>
pub fn external_data(&self) -> Option<&RawExternalData<'a>>
Returns the external data of the sender.
Trait Implementations§
impl<'a> Eq for RawOrigin<'a>
impl<'a> StructuralPartialEq for RawOrigin<'a>
Auto Trait Implementations§
impl<'a> Freeze for RawOrigin<'a>
impl<'a> RefUnwindSafe for RawOrigin<'a>
impl<'a> Send for RawOrigin<'a>
impl<'a> Sync for RawOrigin<'a>
impl<'a> Unpin for RawOrigin<'a>
impl<'a> UnwindSafe for RawOrigin<'a>
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Track for T
impl<T> Track for T
§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Tracked
wrapper. Read more§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Tracked
wrapper. Read more