validation

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ErrQueryTooLong is used in chunk store, querier and query frontend.
	ErrQueryTooLong = "the query time range exceeds the limit (query length: %s, limit: %s)"

	ErrQueryTooOld = "this data is no longer available, it is past now - max_query_lookback (%s)"

	// RateLimited is one of the values for the reason to discard samples.
	// Declared here to avoid duplication in ingester and distributor.
	RateLimited = "rate_limited"

	// Too many HA clusters is one of the reasons for discarding samples.
	TooManyHAClusters = "too_many_ha_clusters"

	// DroppedByRelabelConfiguration Samples can also be discarded because of relabeling configuration
	DroppedByRelabelConfiguration = "relabel_configuration"
	// DroppedByUserConfigurationOverride Samples discarded due to user configuration removing label __name__
	DroppedByUserConfigurationOverride = "user_label_removal_configuration"

	// The combined length of the label names and values of an Exemplar's LabelSet MUST NOT exceed 128 UTF-8 characters
	// https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars
	ExemplarMaxLabelSetLength = 128
)

Variables

This section is empty.

Functions

func MaxDurationOrZeroPerTenant

func MaxDurationOrZeroPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration

MaxDurationOrZeroPerTenant is returning the maximum duration per tenant or zero if one tenant has time.Duration(0).

func MaxDurationPerTenant

func MaxDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration

MaxDurationPerTenant is returning the maximum duration per tenant. Without tenants given it will return a time.Duration(0).

func SmallestPositiveIntPerTenant

func SmallestPositiveIntPerTenant(tenantIDs []string, f func(string) int) int

SmallestPositiveIntPerTenant is returning the minimal positive value of the supplied limit function for all given tenants.

func SmallestPositiveNonZeroDurationPerTenant

func SmallestPositiveNonZeroDurationPerTenant(tenantIDs []string, f func(string) time.Duration) time.Duration

SmallestPositiveNonZeroDurationPerTenant is returning the minimal positive and non-zero value of the supplied limit function for all given tenants. In many limits a value of 0 means unlimited so the method will return 0 only if all inputs have a limit of 0 or an empty tenant list is given.

func SmallestPositiveNonZeroIntPerTenant

func SmallestPositiveNonZeroIntPerTenant(tenantIDs []string, f func(string) int) int

SmallestPositiveNonZeroIntPerTenant is returning the minimal positive and non-zero value of the supplied limit function for all given tenants. In many limits a value of 0 means unlimited so the method will return 0 only if all inputs have a limit of 0 or an empty tenant list is given.

Types

type BlockedQuery

type BlockedQuery struct {
	Pattern string                 `yaml:"pattern"`
	Regex   bool                   `yaml:"regex"`
	Hash    uint32                 `yaml:"hash"`
	Types   flagext.StringSliceCSV `yaml:"types"`
}

type NotificationRateLimitMap

type NotificationRateLimitMap map[string]float64

func (NotificationRateLimitMap) MarshalYAML

func (m NotificationRateLimitMap) MarshalYAML() (interface{}, error)

MarshalYAML implements yaml.Marshaler.

func (NotificationRateLimitMap) Set

Set implements flag.Value

func (NotificationRateLimitMap) String

func (m NotificationRateLimitMap) String() string

String implements flag.Value

func (NotificationRateLimitMap) UnmarshalYAML

func (m NotificationRateLimitMap) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements yaml.Unmarshaler.

Jump to

Keyboard shortcuts

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