Parcourir la source

scenario labels to map string interface (#2201)

* labels are now map string interface

* restore api url

---------

Co-authored-by: Laurence Jones <laurence.jones@live.co.uk>
AlteredCoder il y a 2 ans
Parent
commit
b52b4252c1
2 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 1 1
      pkg/leakybucket/manager_load.go
  2. 1 1
      pkg/leakybucket/overflows.go

+ 1 - 1
pkg/leakybucket/manager_load.go

@@ -43,7 +43,7 @@ type BucketFactory struct {
 	GroupBy             string                    `yaml:"groupby,omitempty"`   //groupy is an expr that allows to determine the partitions of the bucket. A common example is the source_ip
 	Distinct            string                    `yaml:"distinct"`            //Distinct, when present, adds a `Pour()` processor that will only pour uniq items (based on distinct expr result)
 	Debug               bool                      `yaml:"debug"`               //Debug, when set to true, will enable debugging for _this_ scenario specifically
-	Labels              map[string]string         `yaml:"labels"`              //Labels is K:V list aiming at providing context the overflow
+	Labels              map[string]interface{}    `yaml:"labels"`              //Labels is K:V list aiming at providing context the overflow
 	Blackhole           string                    `yaml:"blackhole,omitempty"` //Blackhole is a duration that, if present, will prevent same bucket partition to overflow more often than $duration
 	logger              *log.Entry                `yaml:"-"`                   //logger is bucket-specific logger (used by Debug as well)
 	Reprocess           bool                      `yaml:"reprocess"`           //Reprocess, if true, will for the bucket to be re-injected into processing chain

+ 1 - 1
pkg/leakybucket/overflows.go

@@ -303,7 +303,7 @@ func NewAlert(leaky *Leaky, queue *Queue) (types.RuntimeAlert, error) {
 		newApiAlert := apiAlert
 		srcCopy := srcValue
 		newApiAlert.Source = &srcCopy
-		if v, ok := leaky.BucketConfig.Labels["remediation"]; ok && v == "true" {
+		if v, ok := leaky.BucketConfig.Labels["remediation"]; ok && v == true {
 			newApiAlert.Remediation = true
 		}