metricdata

package
v0.0.0-...-d84dff6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 21, 2022 License: Apache-2.0 Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation interface {
	// contains filtered or unexported methods
}

Aggregation is the store of data reported by an Instrument. It will be one of: Gauge, Sum, Histogram.

type DataPoint

type DataPoint[N int64 | float64] struct {
	// Attributes is the set of key value pairs that uniquely identify the
	// timeseries.
	Attributes attribute.Set
	// StartTime is when the timeseries was started. (optional)
	StartTime time.Time `json:",omitempty"`
	// Time is the time when the timeseries was recorded. (optional)
	Time time.Time `json:",omitempty"`
	// Value is the value of this data point.
	Value N
}

DataPoint is a single data point in a timeseries.

type Gauge

type Gauge[N int64 | float64] struct {
	// DataPoints reprents individual aggregated measurements with unique Attributes.
	DataPoints []DataPoint[N]
}

Gauge represents a measurement of the current value of an instrument.

type Histogram

type Histogram struct {
	// DataPoints reprents individual aggregated measurements with unique Attributes.
	DataPoints []HistogramDataPoint
	// Temporality describes if the aggregation is reported as the change from the
	// last report time, or the cumulative changes since a fixed start time.
	Temporality Temporality
}

Histogram represents the histogram of all measurements of values from an instrument.

type HistogramDataPoint

type HistogramDataPoint struct {
	// Attributes is the set of key value pairs that uniquely identify the
	// timeseries.
	Attributes attribute.Set
	// StartTime is when the timeseries was started.
	StartTime time.Time
	// Time is the time when the timeseries was recorded.
	Time time.Time

	// Count is the number of updates this histogram has been calculated with.
	Count uint64
	// Bounds are the upper bounds of the buckets of the histogram. Because the
	// last boundary is +infinity this one is implied.
	Bounds []float64
	// BucketCounts is the count of each of the buckets.
	BucketCounts []uint64

	// Min is the minimum value recorded. (optional)
	Min *float64 `json:",omitempty"`
	// Max is the maximum value recorded. (optional)
	Max *float64 `json:",omitempty"`
	// Sum is the sum of the values recorded.
	Sum float64
}

HistogramDataPoint is a single histogram data point in a timeseries.

type Metrics

type Metrics struct {
	// Name is the name of the Instrument that created this data.
	Name string
	// Description is the description of the Instrument, which can be used in documentation.
	Description string
	// Unit is the unit in which the Instrument reports.
	Unit unit.Unit
	// Data is the aggregated data from an Instrument.
	Data Aggregation
}

Metrics is a collection of one or more aggregated timeseries from an Instrument.

type ResourceMetrics

type ResourceMetrics struct {
	// Resource represents the entity that collected the metrics.
	Resource *resource.Resource
	// ScopeMetrics are the collection of metrics with unique Scopes.
	ScopeMetrics []ScopeMetrics
}

ResourceMetrics is a collection of ScopeMetrics and the associated Resource that created them.

type ScopeMetrics

type ScopeMetrics struct {
	// Scope is the Scope that the Meter was created with.
	Scope instrumentation.Scope
	// Metrics are a list of aggregations created by the Meter.
	Metrics []Metrics
}

ScopeMetrics is a collection of Metrics Produces by a Meter.

type Sum

type Sum[N int64 | float64] struct {
	// DataPoints reprents individual aggregated measurements with unique Attributes.
	DataPoints []DataPoint[N]
	// Temporality describes if the aggregation is reported as the change from the
	// last report time, or the cumulative changes since a fixed start time.
	Temporality Temporality
	// IsMonotonic represents if this aggregation only increases or decreases.
	IsMonotonic bool
}

Sum represents the sum of all measurements of values from an instrument.

type Temporality

type Temporality uint8

Temporality defines the window that an aggregation was calculated over.

const (

	// CumulativeTemporality defines a measurement interval that continues to
	// expand forward in time from a starting point. New measurements are
	// added to all previous measurements since a start time.
	CumulativeTemporality Temporality

	// DeltaTemporality defines a measurement interval that resets each cycle.
	// Measurements from one cycle are recorded independently, measurements
	// from other cycles do not affect them.
	DeltaTemporality
)

func (Temporality) MarshalText

func (t Temporality) MarshalText() ([]byte, error)

MarshalText returns the byte encoded of t.

func (Temporality) String

func (i Temporality) String() string

Directories

Path Synopsis
Package metricdatatest provides testing functionality for use with the metricdata package.
Package metricdatatest provides testing functionality for use with the metricdata package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL