[][src]Struct opentelemetry::api::metrics::MetricOptions

pub struct MetricOptions {
    pub description: String,
    pub unit: Unit,
    pub keys: Vec<Key>,
    pub alternate: bool,
}

MetricOptions contains some options for metrics of any kind.

Fields

description: String

Description is an optional field describing the metric instrument.

unit: Unit

Unit is an optional field describing the metric instrument. Valid values are specified according to the UCUM.

keys: Vec<Key>

Keys are dimension names for the given metric.

alternate: bool

Alternate defines the property of metric value dependent on a metric type.

  • for Counter, true implies that the metric is an up-down Counter

  • for Gauge, true implies that the metric is a non-descending Gauge

  • for Measure, true implies that the metric supports positive and negative values

Methods

impl MetricOptions[src]

pub fn with_description<S: Into<String>>(self, description: S) -> Self[src]

Set a description for the current set of options.

pub fn with_unit(self, unit: Unit) -> Self[src]

Set a Unit for the current set of metric options.

pub fn with_keys(self, keys: Vec<Key>) -> Self[src]

Set a list of Keys for the current set metric of options.

pub fn with_monotonic(self, _monotonic: bool) -> Self[src]

Set monotonic for the given set of metric options.

pub fn with_absolute(self, absolute: bool) -> Self[src]

Set absolute for the given set of metric options.

Trait Implementations

impl Default for MetricOptions[src]

impl Debug for MetricOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

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