model

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RuleYamlSchema = `` /* 1269-byte string literal not displayed */

Functions

func BuildFindByIdsDSLBody

func BuildFindByIdsDSLBody(ids []string) string

func GetMetricsAlertFingerprint

func GetMetricsAlertFingerprint(uniqueId string, path string, key string) string

func GetMetricsOpRedisFingerprint

func GetMetricsOpRedisFingerprint(uniqueId string, path string, cmd string, key string, statusCode int) string

func GetMetricsWebhookNotifyFingerprint

func GetMetricsWebhookNotifyFingerprint(uniqueId string, path string, statusCode int) string

Types

type BooleanQuery added in v1.1.4

type BooleanQuery string

func (BooleanQuery) GetCountDSL added in v1.1.4

func (b BooleanQuery) GetCountDSL(start time.Time, end time.Time) string

func (BooleanQuery) GetDSL added in v1.1.4

func (b BooleanQuery) GetDSL(from int, size int, start time.Time, end time.Time) string

type EsConfig

type EsConfig struct {
	Addresses   []string `json:"addresses" yaml:"addresses"`
	Username    string   `json:"username" yaml:"username"`
	Password    string   `json:"password" yaml:"password"`
	ConnTimeout uint     `json:"conn_timeout" yaml:"conn_timeout" default:"10"`
	Version     string   `json:"version" yaml:"version" default:"v7"`
}

type Query

type Query struct {
	Type         string            `json:"type" yaml:"type"`
	Config       QueryConfig       `json:"config" yaml:"config"`
	QueryString  string            `json:"query_string" yaml:"query_string"`
	BooleanQuery BooleanQuery      `json:"boolean_query" yaml:"boolean_query"`
	Labels       map[string]string `json:"labels" yaml:"labels"`
	Annotations  map[string]string `json:"annotations" yaml:"annotations"`
}

type QueryConfig added in v1.1.1

type QueryConfig struct {
	Timeframe xtime.TimeLimit `json:"timeframe" yaml:"timeframe"`
	NumEvents uint            `json:"num_events" yaml:"num_events"`
}

type Rule

type Rule struct {
	UniqueId   string          `json:"unique_id" yaml:"unique_id"`
	Enabled    bool            `json:"enabled" yaml:"enabled" default:"true"`
	ES         EsConfig        `json:"es" yaml:"es"`
	Index      string          `json:"index" yaml:"index"`
	RunEvery   xtime.TimeLimit `json:"run_every" yaml:"run_every"`
	Query      Query           `json:"query" yaml:"query"`
	RawContent string          `json:"-"`
	FilePath   string          `json:"-"`
}

func (*Rule) GetEsAddress

func (rl *Rule) GetEsAddress() string

func (*Rule) GetMetricsOpRedisFingerprint

func (rl *Rule) GetMetricsOpRedisFingerprint(cmd string, key string, statusCode int) string

func (*Rule) GetMetricsQueryFingerprint

func (rl *Rule) GetMetricsQueryFingerprint(statusCode int) string

func (*Rule) GetQueryStringCountDSL

func (rl *Rule) GetQueryStringCountDSL(start time.Time, end time.Time) string

func (*Rule) GetQueryStringDSL

func (rl *Rule) GetQueryStringDSL(from int, size int, start time.Time, end time.Time) string

Jump to

Keyboard shortcuts

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