minmaxsumcount

package
v1.28.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

MinMaxSumCount aggregator

Low-cost histogram aggregation

This aggregation offers a low-cost alternative to the ExponentialHistogram for aggregating OpenTelemetry Histogram instruments. This aggregator tracks the Sum, Count, Min, and Max of values recorded by the instrument.

The OTLP exporter will only export the Min and Max fields when used with Delta temporality. See the discussion of Histogram Min/Max and Aggregation Temporality in the OpenTelemetry metrics data model.

Configuring MinMaxSumCount

To select this aggregation, configure a View or the default aggregation to aggregation.MinMaxSumCountKind, e.g.,

view.WithDefaultAggregationKindSelector(func(k sdkinstrument.Kind) aggregation.Kind {
	switch k {
	case sdkinstrument.SyncHistogram:
	    return aggregation.MinMaxSumCountKind
    case sdkinstrument.AsyncGauge:
	    return aggregation.GaugeKind
    default:
	    return aggregation.AnySumKind
	}
}

Or use an instrument hint, e.g.,

	histogram, err := meter.SyncFloat64().Histogram("some.measurement",
		instrument.WithDescription(`{
  "aggregation": "minmaxsumcount"
}`),
	)
OTLP Encoding for MinMaxSimCount

MinMaxSumCount aggregators are encoding using zero-bucket explicit-boundary histogram data points. Lightstep treats these similarly to the OTLP SummaryDataPoint: they are translated into four timeseries each.

  • {metric_name}.sum: Sum of recorded values
  • {metric_name}.count: Count of recorded values
  • {metric_name}.min: Minimum recorded value (with delta temporality)
  • {metric_name}.max: Minimum recorded value (with delta temporality)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float64

type Float64 = State[float64, number.Float64Traits]

func NewFloat64

func NewFloat64(vals ...float64) *Float64

type Float64Methods

type Float64Methods = Methods[float64, number.Float64Traits]

type Int64

type Int64 = State[int64, number.Int64Traits]

func NewInt64

func NewInt64(vals ...int64) *Int64

type Int64Methods

type Int64Methods = Methods[int64, number.Int64Traits]

type Methods

type Methods[N number.Any, Traits number.Traits[N]] struct{}

func (Methods[N, Traits]) Copy

func (Methods[N, Traits]) Copy(from, to *State[N, Traits])

func (Methods[N, Traits]) HasChange

func (Methods[N, Traits]) HasChange(ptr *State[N, Traits]) bool

func (Methods[N, Traits]) Init

func (Methods[N, Traits]) Init(state *State[N, Traits], _ aggregator.Config)

func (Methods[N, Traits]) Kind

func (Methods[N, Traits]) Kind() aggregation.Kind

func (Methods[N, Traits]) Merge

func (Methods[N, Traits]) Merge(from, to *State[N, Traits])

func (Methods[N, Traits]) Move

func (Methods[N, Traits]) Move(from, to *State[N, Traits])

func (Methods[N, Traits]) SubtractSwap

func (Methods[N, Traits]) SubtractSwap(operand, argument *State[N, Traits])

func (Methods[N, Traits]) ToAggregation

func (Methods[N, Traits]) ToAggregation(state *State[N, Traits]) aggregation.Aggregation

func (Methods[N, Traits]) ToStorage

func (Methods[N, Traits]) ToStorage(aggr aggregation.Aggregation) (*State[N, Traits], bool)

func (Methods[N, Traits]) Update

func (Methods[N, Traits]) Update(state *State[N, Traits], number N)

type State

type State[N number.Any, Traits number.Traits[N]] struct {
	// contains filtered or unexported fields
}

func (*State[N, Traits]) Count

func (g *State[N, Traits]) Count() uint64

func (*State[N, Traits]) Kind

func (g *State[N, Traits]) Kind() aggregation.Kind

func (*State[N, Traits]) Max

func (g *State[N, Traits]) Max() number.Number

func (*State[N, Traits]) Min

func (g *State[N, Traits]) Min() number.Number

func (*State[N, Traits]) Sum

func (g *State[N, Traits]) Sum() number.Number

Jump to

Keyboard shortcuts

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