Documentation
¶
Index ¶
- type Alert
- type Channel
- type ConditionOption
- func Avg(refID string, from string, to string) ConditionOption
- func Count(refID string, from string, to string) ConditionOption
- func Diff(refID string, from string, to string) ConditionOption
- func HasNoValue() ConditionOption
- func IsAbove(value float64) ConditionOption
- func IsBelow(value float64) ConditionOption
- func IsOutsideRange(min float64, max float64) ConditionOption
- func IsWithinRange(min float64, max float64) ConditionOption
- func Last(refID string, from string, to string) ConditionOption
- func Max(refID string, from string, to string) ConditionOption
- func Median(refID string, from string, to string) ConditionOption
- func Min(refID string, from string, to string) ConditionOption
- func PercentDiff(refID string, from string, to string) ConditionOption
- func Sum(refID string, from string, to string) ConditionOption
- type ErrorMode
- type NoDataMode
- type Operator
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConditionOption ¶
type ConditionOption func(condition *condition)
func Avg ¶
func Avg(refID string, from string, to string) ConditionOption
Avg defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func Count ¶
func Count(refID string, from string, to string) ConditionOption
Avg defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func Diff ¶
func Diff(refID string, from string, to string) ConditionOption
Diff defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func HasNoValue ¶
func HasNoValue() ConditionOption
func IsAbove ¶
func IsAbove(value float64) ConditionOption
func IsBelow ¶
func IsBelow(value float64) ConditionOption
func IsOutsideRange ¶
func IsOutsideRange(min float64, max float64) ConditionOption
func IsWithinRange ¶
func IsWithinRange(min float64, max float64) ConditionOption
func Last ¶
func Last(refID string, from string, to string) ConditionOption
Avg defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func Max ¶
func Max(refID string, from string, to string) ConditionOption
Max defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func Median ¶
func Median(refID string, from string, to string) ConditionOption
Median defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func Min ¶
func Min(refID string, from string, to string) ConditionOption
Min defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func PercentDiff ¶
func PercentDiff(refID string, from string, to string) ConditionOption
PercentDiff defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
func Sum ¶
func Sum(refID string, from string, to string) ConditionOption
Avg defines the query to execute. See https://grafana.com/docs/grafana/latest/alerting/rules/#query-condition-example
type ErrorMode ¶
type ErrorMode string
const Alerting ErrorMode = "alerting"
const LastState ErrorMode = "keep_state"
type NoDataMode ¶
type NoDataMode string
const Error NoDataMode = "alerting"
const KeepLastState NoDataMode = "keep_state"
const NoData NoDataMode = "no_data"
const OK NoDataMode = "ok"
type Option ¶
type Option func(alert *Alert)
func EvaluateEvery ¶
EvaluateEvery defines the evaluation interval.
func For ¶
For sets the time interval during which a query violating the threshold before the alert being actually triggered. See https://grafana.com/docs/grafana/latest/alerting/rules/#for
func If ¶
func If(operator Operator, opts ...ConditionOption) Option
If adds a condition that could trigger the alert. See https://grafana.com/docs/grafana/latest/alerting/rules/#conditions
func Notification ¶
Notification adds a notification for this alert.
func OnExecutionError ¶
OnExecutionError defines the behavior on execution error. See https://grafana.com/docs/grafana/latest/alerting/rules/#execution-errors-or-timeouts
func OnNoData ¶
func OnNoData(mode NoDataMode) Option
OnNoData defines the behavior when the query returns no data. See https://grafana.com/docs/grafana/latest/alerting/rules/#no-data-null-values