custom alerting

Signed-off-by: junotx <junotx@126.com>
This commit is contained in:
junotx
2020-11-24 17:56:26 +08:00
parent 242193ddb0
commit 371c9b187d
342 changed files with 64021 additions and 1934 deletions

View File

@@ -0,0 +1,31 @@
package rules
import (
promresourcesv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
"kubesphere.io/kubesphere/pkg/api/customalerting/v1alpha1"
)
type ResourceRules struct {
GroupSet map[string]struct{}
IdRules map[string]*ResourceRule
NameRules map[string][]*ResourceRule
}
type ResourceRule struct {
ResourceName string
Group string
Id string
Rule *promresourcesv1.Rule
}
type ResourceRuleSole struct {
Level v1alpha1.RuleLevel
Custom bool
ResourceRule
}
type ResourceRuleChunk struct {
Level v1alpha1.RuleLevel
Custom bool
ResourceRulesMap map[string]*ResourceRules
}