pub struct ExternalData { /* private fields */ }
Expand description
External Data associated with an origin.
“External Data” is a concept that is used to aid origin detection of workloads running in Kubernetes environments where introspection is not possible or may return incorrect information. Origin detection generally centers around determining the container where a metric originates from, and then enriching the metric with tags that describe that container, as well as the pod the container is running within, and so on. In some cases, the origin of a metric cannot be detected from the outside (such as by using peer credentials over Unix Domain sockets) and cannot be detected by the workload itself (such as when running in nested virtualization environments). In these cases, we need a mechanism that allows passing the necessary information to the client, who then passes it on to us, so that we can correctly resolve the origin.
“External Data” supports this by allowing for an external Kubernetes admission controller to attach specific metadata – pod UID and container name – to application pods, which is then read and sent along with metrics. This information is then used during origin detection in order to correlate the container ID of the origin, which is sufficient to allow enriching the metric with container-specific tags.
§Format
An External Data string is a comma-separated list of key/value pairs, where each key represents a particular aspect of the workload entity. The following keys are supported:
it-<true/false>
: A boolean value indicating whether the entity is an init container.pu-<pod_uid>
: The pod UID associated with the entity.cn-<container_name>
: The container name associated with the entity.
For parsing external data strings without allocating, see RawExternalData
.
Implementations§
Source§impl ExternalData
impl ExternalData
Sourcepub fn new(
pod_uid: MetaString,
container_name: MetaString,
init_container: bool,
) -> Self
pub fn new( pod_uid: MetaString, container_name: MetaString, init_container: bool, ) -> Self
Creates a new ExternalData
instance.
Sourcepub fn container_name(&self) -> &MetaString
pub fn container_name(&self) -> &MetaString
Returns the container name.
Sourcepub fn is_init_container(&self) -> bool
pub fn is_init_container(&self) -> bool
Returns true
if the entity is an init container.
Trait Implementations§
Source§impl Clone for ExternalData
impl Clone for ExternalData
Source§fn clone(&self) -> ExternalData
fn clone(&self) -> ExternalData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ExternalData
impl Debug for ExternalData
Source§impl Equivalent<ExternalData> for RawExternalData<'_>
impl Equivalent<ExternalData> for RawExternalData<'_>
Source§fn equivalent(&self, other: &ExternalData) -> bool
fn equivalent(&self, other: &ExternalData) -> bool
key
and return true
if they are equal.Source§impl Hash for ExternalData
impl Hash for ExternalData
Source§impl PartialEq for ExternalData
impl PartialEq for ExternalData
Source§impl Serialize for ExternalData
impl Serialize for ExternalData
impl Eq for ExternalData
impl StructuralPartialEq for ExternalData
Auto Trait Implementations§
impl Freeze for ExternalData
impl RefUnwindSafe for ExternalData
impl Send for ExternalData
impl Sync for ExternalData
impl Unpin for ExternalData
impl UnwindSafe for ExternalData
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