The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/pkg/services/alerting/models.go

56 lines
895 B

package alerting
import (
"time"
"github.com/grafana/grafana/pkg/components/simplejson"
)
type AlertJob struct {
Offset int64
Delay bool
Running bool
RetryCount int
Rule *AlertRule
}
func (aj *AlertJob) Retryable() bool {
return aj.RetryCount < maxAlertExecutionRetries
}
func (aj *AlertJob) ResetRetry() {
aj.RetryCount = 0
}
func (aj *AlertJob) IncRetry() {
aj.RetryCount++
}
type AlertResultContext struct {
Triggered bool
Details []*AlertResultDetail
Error error
Description string
StartTime time.Time
EndTime time.Time
Rule *AlertRule
}
type AlertResultDetail struct {
Value float64
Metric string
State string
Tags map[string]string
}
type Level struct {
Operator string
Value float64
}
type AlertQuery struct {
Model *simplejson.Json
DatasourceId int64
From string
To string
}