Skip to main content

MetricPacket

Struct MetricPacket 

Source
pub struct MetricPacket<'a> {
    pub metric_name: &'a str,
    pub tags: RawTags<'a>,
    pub values: MetricValues,
    pub num_points: u64,
    pub timestamp: Option<u64>,
    pub local_data: Option<&'a str>,
    pub external_data: Option<&'a str>,
    pub cardinality: Option<OriginTagCardinality>,
    pub unit: Option<&'static str>,
}
Expand description

A DogStatsD metric packet.

See the DogStatsD datagram format reference for the wire format and the protocol versions that introduced each field.

Fields§

§metric_name: &'a str

Name of the metric.

§tags: RawTags<'a>

Tags attached to the metric.

§values: MetricValues

The metric kind (counter, gauge, rate, etc.) and its sample points.

§num_points: u64

Number of sample points represented by values.

§timestamp: Option<u64>

Optional Unix timestamp for the sample, in seconds (protocol v1.3).

§local_data: Option<&'a str>

Local Data attached to the metric, carried in the c: field (protocol v1.2, extended in v1.4).

Identifies the workload that emitted the metric. Carries a container ID (ci-<id>) or, when unavailable, a cgroup node inode (in-<inode>).

§external_data: Option<&'a str>

External Data attached to the metric, carried in the e: field (protocol v1.5).

Used to convey a richer blob of workload identity data resolved by the receiver.

§cardinality: Option<OriginTagCardinality>

Cardinality hint for origin tag enrichment, carried in the card: field (protocol v1.6).

Specifies which origin tags the receiver should attach to the metric.

§unit: Option<&'static str>

Unit for this metric, if any.

Auto Trait Implementations§

§

impl<'a> Freeze for MetricPacket<'a>

§

impl<'a> RefUnwindSafe for MetricPacket<'a>

§

impl<'a> Send for MetricPacket<'a>

§

impl<'a> Sync for MetricPacket<'a>

§

impl<'a> Unpin for MetricPacket<'a>

§

impl<'a> UnsafeUnpin for MetricPacket<'a>

§

impl<'a> UnwindSafe for MetricPacket<'a>

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Track for T

Source§

fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>

Instruments this type by attaching the given allocation group token, returning a Tracked wrapper. Read more
Source§

fn in_current_allocation_group(self) -> Tracked<Self>

Instruments this type by attaching the current allocation group, returning a Tracked wrapper. Read more
Source§

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

Source§

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>,

Source§

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.
Source§

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

Source§

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