normalization

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Normalizer

type Normalizer interface {
	// NormalizeExponentialHistogramDataPoint normalizes an exponential histogram.
	// It returns the normalized point, and true if the point should be kept.
	NormalizeExponentialHistogramDataPoint(point pmetric.ExponentialHistogramDataPoint, identifier string) (pmetric.ExponentialHistogramDataPoint, bool)
	// NormalizeHistogramDataPoint normalizes a cumulative histogram.
	// It returns the normalized point, and true if the point should be kept.
	NormalizeHistogramDataPoint(point pmetric.HistogramDataPoint, identifier string) (pmetric.HistogramDataPoint, bool)
	// NormalizeNumberDataPoint normalizes a cumulative, monotonic sum.
	// It returns the normalized point, and true if the point should be kept.
	NormalizeNumberDataPoint(point pmetric.NumberDataPoint, identifier string) (pmetric.NumberDataPoint, bool)
	// NormalizeSummaryDataPoint normalizes a summary.
	// It returns the normalized point, and true if the point should be kept.
	NormalizeSummaryDataPoint(point pmetric.SummaryDataPoint, identifier string) (pmetric.SummaryDataPoint, bool)
}

Normalizer can normalize data points to handle cases in which the start time is unknown.

func NewDisabledNormalizer

func NewDisabledNormalizer() Normalizer

NewDisabledNormalizer returns a Normalizer which does not perform any normalization. This may be useful if standard normalization consumes too much memory. For explicit reset points described in https://github.com/open-telemetry/opentelemetry-specification/blob/9555f9594c7ffe5dc333b53da5e0f880026cead1/specification/metrics/datamodel.md#resets-and-gaps it adjusts the end time to be after the start time to make the points valid without changing the start time (which causes the point to reset).

func NewStandardNormalizer

func NewStandardNormalizer(shutdown <-chan struct{}, logger *zap.Logger) Normalizer

NewStandardNormalizer performs normalization on cumulative points which:

(a) don't have a start time, OR
(b) have been sent a preceding "reset" point as described in https://github.com/open-telemetry/opentelemetry-specification/blob/9555f9594c7ffe5dc333b53da5e0f880026cead1/specification/metrics/datamodel.md#resets-and-gaps

The first point without a start time or the reset point is cached, and is NOT exported. Subsequent points "subtract" the initial point prior to exporting. This normalizer also detects subsequent resets, and produces a new start time for those points. It doesn't modify values after a reset, but does give it a new start time.

Jump to

Keyboard shortcuts

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