Struct tremor_otelapis::opentelemetry::proto::metrics::v1::Metric[][src]

pub struct Metric {
    pub name: String,
    pub description: String,
    pub unit: String,
    pub data: Option<Data>,
}

Defines a Metric which has one or more timeseries.

The data model and relation between entities is shown in the diagram below. Here, “DataPoint” is the term used to refer to any one of the specific data point value types, and “points” is the term used to refer to any one of the lists of points contained in the Metric.

  • Metric is composed of a metadata and data.

  • Metadata part contains a name, description, unit.

  • Data is one of the possible types (Gauge, Sum, Histogram, etc.).

  • DataPoint contains timestamps, labels, and one of the possible value type fields.

    Metric +————+ |name | |description | |unit | +————————————+ |data |—> |Gauge, Sum, Histogram, Summary, … | +————+ +————————————+

    Data [One of Gauge, Sum, Histogram, Summary, …] +———–+ |… | // Metadata about the Data. |points |–+ +———–+ | | +—————————+ | |DataPoint 1 | v |+——+——+ +——+ | +—–+ ||label |label |…|label | | | 1 |–>||value1|value2|…|valueN| | +—–+ |+——+——+ +——+ | | . | |+—–+ | | . | ||value| | | . | |+—–+ | | . | +—————————+ | . | . | . | . | . | . | . | +—————————+ | . | |DataPoint M | +—–+ |+——+——+ +——+ | | M |–>||label |label |…|label | | +—–+ ||value1|value2|…|valueN| | |+——+——+ +——+ | |+—–+ | ||value| | |+—–+ | +—————————+

All DataPoint types have three common fields:

  • Labels zero or more key-value pairs associated with the data point.
  • StartTimeUnixNano MUST be set to the start of the interval when the data’s type includes an AggregationTemporality. This field is not set otherwise.
  • TimeUnixNano MUST be set to:
    • the moment when an aggregation is reported (independent of the aggregation temporality).
    • the instantaneous time of the event.

Fields

name: String

name of the metric, including its DNS name prefix. It must be unique.

description: String

description of the metric, which can be used in documentation.

unit: String

unit in which the metric value is reported. Follows the format described by http://unitsofmeasure.org/ucum.html.

data: Option<Data>

Data determines the aggregation type (if any) of the metric, what is the reported value type for the data points, as well as the relatationship to the time interval over which they are reported.

TODO: Update table after the decision on: https://github.com/open-telemetry/opentelemetry-specification/issues/731. By default, metrics recording using the OpenTelemetry API are exported as (the table does not include MeasurementValueType to avoid extra rows):

Instrument Type

Counter Sum(aggregation_temporality=delta;is_monotonic=true) UpDownCounter Sum(aggregation_temporality=delta;is_monotonic=false) ValueRecorder TBD SumObserver Sum(aggregation_temporality=cumulative;is_monotonic=true) UpDownSumObserver Sum(aggregation_temporality=cumulative;is_monotonic=false) ValueObserver Gauge()

Trait Implementations

impl Clone for Metric[src]

impl Debug for Metric[src]

impl Default for Metric[src]

impl Message for Metric[src]

impl PartialEq<Metric> for Metric[src]

impl StructuralPartialEq for Metric[src]

Auto Trait Implementations

impl RefUnwindSafe for Metric

impl Send for Metric

impl Sync for Metric

impl Unpin for Metric

impl UnwindSafe for Metric

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]