rules

package
v0.0.0-...-88d12aa Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromPath

func FromPath(path, region string) (*fileStore, error)

Types

type Rule

type Rule struct {
	Version           string
	Namespace         string
	Name              string
	Database          string
	Interval          time.Duration
	Query             string
	AutoMitigateAfter time.Duration
	Destination       string

	// Criteria is a map of key-value pairs that are used to determine where an alert can execute.
	Criteria map[string][]string

	// Management queries (starts with a dot) have to call a different
	// query API in the Kusto Go SDK.
	IsMgmtQuery bool

	// Stmt specifies the underlayEtcdPeersQuery to execute.
	Stmt kusto.Stmt
}

Rule is analogous to a kusto-to-metric configuration, containing definitions and using the parlance found in the k2m UI.

type Store

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

func NewStore

func NewStore(opts StoreOpts) *Store

func (*Store) Close

func (s *Store) Close() error

func (*Store) Open

func (s *Store) Open(ctx context.Context) error

func (*Store) Register

func (s *Store) Register(rule *Rule)

func (*Store) Rules

func (s *Store) Rules() []*Rule

type StoreOpts

type StoreOpts struct {
	Region  string
	CtrlCli client.Client
}

Jump to

Keyboard shortcuts

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