aggregation

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

View Source
const (
	NameCumulative = "cumulative"
	NameDelta      = "delta"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregation

type Aggregation interface {
	Kind() Kind
}

Aggregation is an interface returned by the Aggregator containing an interval of metric data.

type Buckets

type Buckets interface {
	Offset() int32
	Len() uint32
	At(uint32) uint64
}

Buckets describes a range of consecutive buckets, starting at Offset(). This type is used to encode either the positive or negative ranges of an Histogram.

type Category

type Category int

Category constants describe semantic kind. For the histogram category there are multiple implementations, for those distinctions as well as Drop, use Kind.

const (
	UndefinedCategory Category = iota
	MonotonicSumCategory
	NonMonotonicSumCategory
	GaugeCategory
	HistogramCategory
)

func (Category) String

func (i Category) String() string

type CumulativeTemporalityTrait

type CumulativeTemporalityTrait struct{}

func (CumulativeTemporalityTrait) Temporality

type DeltaTemporalityTrait

type DeltaTemporalityTrait struct{}

func (DeltaTemporalityTrait) Temporality

func (DeltaTemporalityTrait) Temporality() Temporality

type Gauge

type Gauge interface {
	Aggregation

	// Gauge returns the most recently observed value.
	Gauge() number.Number
}

Gauge returns the latest value that was aggregated.

type HasASum

type HasASum interface {
	Sum() number.Number
}

HasASum includes Sum and Histogram aggregators.

type Histogram

type Histogram interface {
	Aggregation
	Count() uint64
	HasASum
	Scale() int32
	ZeroCount() uint64
	Positive() Buckets
	Negative() Buckets
	Min() number.Number
	Max() number.Number
}

Histogram returns the count of events in exponential-scale buckets defined as a function of a scale parameter. See a detailed explanation in the OpenTelemetry metrics data model: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/datamodel.md#exponentialhistogram

type Kind

type Kind int
const (
	UndefinedKind Kind = iota
	DropKind
	AnySumKind
	MonotonicSumKind
	NonMonotonicSumKind
	GaugeKind
	HistogramKind
	MinMaxSumCountKind
)

func ParseKind

func ParseKind(str string) (Kind, bool)

ParseKind returns the enumerated constant and true if the string corresponds with a known aggregation kind.

func (Kind) Category

func (k Kind) Category(ik sdkinstrument.Kind) Category

func (Kind) String

func (i Kind) String() string

func (Kind) Valid

func (k Kind) Valid() bool

Valid returns true when the value is one of the enumerated constants.

type KindSelector

type KindSelector func(sdkinstrument.Kind) Kind

KindSelector is a per-instrument-kind Kind choice.

type MinMaxSumCount

type MinMaxSumCount interface {
	Aggregation
	Count() uint64
	HasASum
	Min() number.Number
	Max() number.Number
}

MinMaxSumCount is a low cost HistogramCategory aggregator that records the Min, Max, Sum, and Count.

type Sum

type Sum interface {
	// Review NOTE: Should this be Total() or Value()?
	HasASum
	IsMonotonic() bool
}

Sum returns an aggregated sum.

type Temporality

type Temporality uint8
const (
	// UndefinedTemporality indicates that temporality is not defined.
	UndefinedTemporality Temporality = 0

	// CumulativeTemporality indicates that an Exporter expects a
	// Cumulative Aggregation.
	CumulativeTemporality Temporality = 1

	// DeltaTemporality indicates that an Exporter expects a
	// Delta Aggregation.
	DeltaTemporality Temporality = 2
)

func LowMemoryTemporality added in v1.17.0

func LowMemoryTemporality(k sdkinstrument.Kind) Temporality

func ParseTemporality added in v1.16.0

func ParseTemporality(str string) (Temporality, bool)

func (Temporality) String

func (t Temporality) String() string

func (Temporality) Valid

func (t Temporality) Valid() bool

type TemporalitySelector

type TemporalitySelector func(sdkinstrument.Kind) Temporality

type TemporalityTrait

type TemporalityTrait interface {
	Temporality() Temporality
}

Jump to

Keyboard shortcuts

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