cortex

package
v0.12.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetadataCortexNamespace = "opni.io/cortex-rule-namespace"
	MetadataCortexGroup     = "opni.io/cortex-rule-group"
	MetadataCortexRuleName  = "opni.io/cortex-rule-name"
)

Variables

This section is empty.

Functions

func ConstructFiltersFromMap

func ConstructFiltersFromMap(in map[string]string) string

func ConstructIdLabelsForRecordingRule

func ConstructIdLabelsForRecordingRule(alertId string) map[string]string

func ConstructRecordingRuleName

func ConstructRecordingRuleName(prefix, typeName string) string

func NewPrometheusAlertingRule added in v0.9.0

func NewPrometheusAlertingRule(
	alertId,
	_ string,
	opniLabels,
	opniAnnotations map[string]string,
	info alertingv1.IndexableMetric,
	interval *time.Duration,
	rule metrics.AlertRuleBuilder,
) (ruleGroup *rulefmt.RuleGroup, metadata map[string]string, err error)

func ReducePrometheusMatrix added in v0.9.0

func ReducePrometheusMatrix(matrix *model.Matrix) []*alertingv1.ActiveWindow

`ALERTS` can have several root causes for causing the active alerting rule to fire; prometheus store each root cause as a separate synthetic timeseries. This function reduces the matrix of synthetic timeseries into a single array of sorted active windows !! Assumes the input matrix is non-nil

func RuleIdFromUuid added in v0.9.0

func RuleIdFromUuid(id string) string

func TimeDurationToPromStr

func TimeDurationToPromStr(t time.Duration) string

Types

type MatrixHeap added in v0.9.0

type MatrixHeap []MatrixRef

Implements the container/heap.Heap interface

func (MatrixHeap) Len added in v0.9.0

func (h MatrixHeap) Len() int

func (MatrixHeap) Less added in v0.9.0

func (h MatrixHeap) Less(i, j int) bool

func (*MatrixHeap) Pop added in v0.9.0

func (h *MatrixHeap) Pop() any

func (*MatrixHeap) Push added in v0.9.0

func (h *MatrixHeap) Push(x any)

func (MatrixHeap) Swap added in v0.9.0

func (h MatrixHeap) Swap(i, j int)

type MatrixRef added in v0.9.0

type MatrixRef lo.Tuple3[int, int, *model.SamplePair]

MatrixRef A : Refers to the index of a specific metric in the matrix B : Refers to the position in the metric.Values array to process

Jump to

Keyboard shortcuts

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