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/apps/alerting/notifications/pkg/apis/resource/routingtree/v0alpha1/ext.go

36 lines
882 B

package v0alpha1
import (
"github.com/grafana/grafana/apps/alerting/common"
)
// Re-define some enum values with confusing names
// TODO figure out how we can control name of enum
const (
MatcherTypeNotEqual MatcherType = "!="
MatcherTypeEqualRegex MatcherType = "=~"
MatcherTypeNotEqualRegex MatcherType = "!~"
)
const UserDefinedRoutingTreeName = "user-defined"
func (o *RoutingTree) GetProvenanceStatus() string {
if o == nil || o.Annotations == nil {
return ""
}
s, ok := o.Annotations[common.ProvenanceStatusAnnotationKey]
if !ok || s == "" {
return common.ProvenanceStatusNone
}
return s
}
func (o *RoutingTree) SetProvenanceStatus(status string) {
if o.Annotations == nil {
o.Annotations = make(map[string]string, 1)
}
if status == "" {
status = common.ProvenanceStatusNone
}
o.Annotations[common.ProvenanceStatusAnnotationKey] = status
}