aggregator

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregator

type Aggregator struct {
	// contains filtered or unexported fields
}

Aggregator provides a single interface to update all metrics datastructures. The required datastructure is selected using the metric definition.

func NewAggregator

func NewAggregator(metrics pmetric.Metrics, ephemeralID string) *Aggregator

NewAggregator creates a new instance of aggregator.

func (*Aggregator) Add

func (a *Aggregator) Add(
	md model.MetricDef,
	resAttrs, srcAttrs pcommon.Map,
	spanDuration time.Duration,
	adjustedCount uint64,
) error

Add adds a span duration into the configured metrics. It also takes `adjustedCount` parameter to denote the total number of spans in the population that are represented by an individually sampled span. The adjusted count is is calculated as per: https://opentelemetry.io/docs/specs/otel/trace/tracestate-probability-sampling/#adjusted-count

func (*Aggregator) Finalize

func (a *Aggregator) Finalize(mds []model.MetricDef)

Finalize finalizes the aggregations performed by the aggregator so far into the pmetric.Metrics used to create this instance of the aggregator. Finalize should be called once per aggregator instance and the aggregator instance should not be used after Finalize is called.

Jump to

Keyboard shortcuts

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