warnings

package
v0.6.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MixedFloatsHistogramsAggWarning = fmt.Errorf("%w aggregation", annotations.MixedFloatsHistogramsWarning)

MixedFloatsHistogramsAggWarning is used when an aggregation encounters both floats and histograms. We define this here because Prometheus's NewMixedFloatsHistogramsAggWarning requires a posrange which we don't have at the accumulator level.

Functions

func AddToContext

func AddToContext(warn error, ctx context.Context)

func Coalesce

func Coalesce(a, b error) error

func ConvertHistogramError added in v0.5.0

func ConvertHistogramError(err error) error

ConvertHistogramError converts histogram operation errors to appropriate annotation warnings. Returns nil if the error is not a histogram error.

func FromContext

func FromContext(ctx context.Context) annotations.Annotations

func MergeToContext

func MergeToContext(annos annotations.Annotations, ctx context.Context)

func NewContext

func NewContext(ctx context.Context) context.Context

Types

type Warnings added in v0.5.0

type Warnings uint32

Warnings is a bitset of warning flags that can be returned by functions to indicate warning conditions. The actual warning messages with metric names are emitted by operators that have access to series labels.

const (
	WarnNotCounter Warnings = 1 << iota
	WarnNotGauge
	WarnMixedFloatsHistograms
	WarnMixedExponentialCustomBuckets
	WarnHistogramIgnoredInMixedRange  // for _over_time functions, only when both floats and histograms
	WarnHistogramIgnoredInAggregation // for aggregations (max, min, stddev, etc.), always when histograms ignored
	WarnCounterResetCollision
	WarnNHCBBoundsReconciled    // for subtraction operations (rate, irate, delta)
	WarnNHCBBoundsReconciledAgg // for aggregation operations (sum, avg, sum_over_time, avg_over_time)
	WarnIncompatibleTypesInBinOp
)

Jump to

Keyboard shortcuts

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