otel: go.opentelemetry.io/otel/sdk/export/metric/aggregation Index | Files

package aggregation

import "go.opentelemetry.io/otel/sdk/export/metric/aggregation"

Index

Package Files

aggregation.go

Variables

var (
    ErrInvalidQuantile  = fmt.Errorf("the requested quantile is out of range")
    ErrNegativeInput    = fmt.Errorf("negative value is out of range for this instrument")
    ErrNaNInput         = fmt.Errorf("NaN value is an invalid input")
    ErrInconsistentType = fmt.Errorf("inconsistent aggregator types")
    ErrNoSubtraction    = fmt.Errorf("aggregator does not subtract")

    // ErrNoData is returned when (due to a race with collection)
    // the Aggregator is check-pointed before the first value is set.
    // The aggregator should simply be skipped in this case.
    ErrNoData = fmt.Errorf("no data collected by this aggregator")
)

type Aggregation Uses

type Aggregation interface {
    // Kind returns a short identifying string to identify
    // the Aggregator that was used to produce the
    // Aggregation (e.g., "Sum").
    Kind() Kind
}

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

type Buckets Uses

type Buckets struct {
    // Boundaries are floating point numbers, even when
    // aggregating integers.
    Boundaries []float64

    // Counts are floating point numbers to account for
    // the possibility of sampling which allows for
    // non-integer count values.
    Counts []float64
}

Buckets represents histogram buckets boundaries and counts.

For a Histogram with N defined boundaries, e.g, [x, y, z]. There are N+1 counts: [-inf, x), [x, y), [y, z), [z, +inf]

type Count Uses

type Count interface {
    Aggregation
    Count() (int64, error)
}

Count returns the number of values that were aggregated.

type Distribution Uses

type Distribution interface {
    Aggregation
    Min() (otel.Number, error)
    Max() (otel.Number, error)
    Sum() (otel.Number, error)
    Count() (int64, error)
    Quantile(float64) (otel.Number, error)
}

Distribution supports the Min, Max, Sum, Count, and Quantile interfaces.

type Histogram Uses

type Histogram interface {
    Aggregation
    Count() (int64, error)
    Sum() (otel.Number, error)
    Histogram() (Buckets, error)
}

Histogram returns the count of events in pre-determined buckets.

type Kind Uses

type Kind string

Kind is a short name for the Aggregator that produces an Aggregation, used for descriptive purpose only. Kind is a string to allow user-defined Aggregators.

When deciding how to handle an Aggregation, Exporters are encouraged to decide based on conversion to the above interfaces based on strength, not on Kind value, when deciding how to expose metric data. This enables user-supplied Aggregators to replace builtin Aggregators.

For example, test for a Distribution before testing for a MinMaxSumCount, test for a Histogram before testing for a Sum, and so on.

const (
    SumKind            Kind = "Sum"
    MinMaxSumCountKind Kind = "MinMaxSumCount"
    HistogramKind      Kind = "Histogram"
    LastValueKind      Kind = "Lastvalue"
    SketchKind         Kind = "Sketch"
    ExactKind          Kind = "Exact"
)

func (Kind) String Uses

func (k Kind) String() string

String returns the string value of Kind.

type LastValue Uses

type LastValue interface {
    Aggregation
    LastValue() (otel.Number, time.Time, error)
}

LastValue returns the latest value that was aggregated.

type Max Uses

type Max interface {
    Aggregation
    Max() (otel.Number, error)
}

Max returns the maximum value over the set of values that were aggregated.

type Min Uses

type Min interface {
    Aggregation
    Min() (otel.Number, error)
}

Min returns the minimum value over the set of values that were aggregated.

type MinMaxSumCount Uses

type MinMaxSumCount interface {
    Aggregation
    Min() (otel.Number, error)
    Max() (otel.Number, error)
    Sum() (otel.Number, error)
    Count() (int64, error)
}

MinMaxSumCount supports the Min, Max, Sum, and Count interfaces.

type Points Uses

type Points interface {
    Aggregation
    Points() ([]otel.Number, error)
}

Points returns the raw set of values that were aggregated.

type Quantile Uses

type Quantile interface {
    Aggregation
    Quantile(float64) (otel.Number, error)
}

Quantile returns an exact or estimated quantile over the set of values that were aggregated.

type Sum Uses

type Sum interface {
    Aggregation
    Sum() (otel.Number, error)
}

Sum returns an aggregated sum.

Package aggregation imports 3 packages (graph) and is imported by 18 packages. Updated 2020-10-17. Refresh now. Tools for package owners.