package aggregate
import "go.opentelemetry.io/otel/sdk/metric/internal/aggregate"
Package aggregate provides aggregate types used compute aggregations and cycle the state of metric measurements made by the SDK. These types and functionality are meant only for internal SDK use.
Index ¶
- type Builder
- func (b Builder[N]) ExplicitBucketHistogram(boundaries []float64, noMinMax, noSum bool) (Measure[N], ComputeAggregation)
- func (b Builder[N]) ExponentialBucketHistogram(maxSize, maxScale int32, noMinMax, noSum bool) (Measure[N], ComputeAggregation)
- func (b Builder[N]) LastValue() (Measure[N], ComputeAggregation)
- func (b Builder[N]) PrecomputedSum(monotonic bool) (Measure[N], ComputeAggregation)
- func (b Builder[N]) Sum(monotonic bool) (Measure[N], ComputeAggregation)
- type ComputeAggregation
- type Measure
Types ¶
type Builder ¶
type Builder[N int64 | float64] struct { // Temporality is the temporality used for the returned aggregate function. // // If this is not provided a default of cumulative will be used (except for // the last-value aggregate function where delta is the only appropriate // temporality). Temporality metricdata.Temporality // Filter is the attribute filter the aggregate function will use on the // input of measurements. Filter attribute.Filter // ReservoirFunc is the factory function used by aggregate functions to // create new exemplar reservoirs for a new seen attribute set. // // If this is not provided a default factory function that returns an // exemplar.Drop reservoir will be used. ReservoirFunc func() exemplar.Reservoir[N] // AggregationLimit is the cardinality limit of measurement attributes. Any // measurement for new attributes once the limit has been reached will be // aggregated into a single aggregate for the "otel.metric.overflow" // attribute. // // If AggregationLimit is less than or equal to zero there will not be an // aggregation limit imposed (i.e. unlimited attribute sets). AggregationLimit int }
Builder builds an aggregate function.
func (Builder[N]) ExplicitBucketHistogram ¶
func (b Builder[N]) ExplicitBucketHistogram(boundaries []float64, noMinMax, noSum bool) (Measure[N], ComputeAggregation)
ExplicitBucketHistogram returns a histogram aggregate function input and output.
func (Builder[N]) ExponentialBucketHistogram ¶
func (b Builder[N]) ExponentialBucketHistogram(maxSize, maxScale int32, noMinMax, noSum bool) (Measure[N], ComputeAggregation)
ExponentialBucketHistogram returns a histogram aggregate function input and output.
func (Builder[N]) LastValue ¶
func (b Builder[N]) LastValue() (Measure[N], ComputeAggregation)
LastValue returns a last-value aggregate function input and output.
The Builder.Temporality is ignored and delta is use always.
func (Builder[N]) PrecomputedSum ¶
func (b Builder[N]) PrecomputedSum(monotonic bool) (Measure[N], ComputeAggregation)
PrecomputedSum returns a sum aggregate function input and output. The arguments passed to the input are expected to be the precomputed sum values.
func (Builder[N]) Sum ¶
func (b Builder[N]) Sum(monotonic bool) (Measure[N], ComputeAggregation)
Sum returns a sum aggregate function input and output.
type ComputeAggregation ¶
type ComputeAggregation func(dest *metricdata.Aggregation) int
ComputeAggregation stores the aggregate of measurements into dest and returns the number of aggregate data-points output.
type Measure ¶
Measure receives measurements to be aggregated.
Source Files ¶
aggregate.go doc.go exponential_histogram.go histogram.go lastvalue.go limit.go sum.go
- Version
- v1.23.0
- Published
- Feb 6, 2024
- Platform
- linux/amd64
- Imports
- 10 packages
- Last checked
- 51 minutes ago –
Tools for package owners.