diff --git a/pkg/leakybucket/bucket.go b/pkg/leakybucket/bucket.go index f9b360241..f4964652d 100644 --- a/pkg/leakybucket/bucket.go +++ b/pkg/leakybucket/bucket.go @@ -70,6 +70,7 @@ type Leaky struct { wgPour *sync.WaitGroup wgDumpState *sync.WaitGroup mutex *sync.Mutex //used only for TIMEMACHINE mode to allow garbage collection without races + labels map[string]string } var BucketsPour = prometheus.NewCounterVec( @@ -177,6 +178,7 @@ func FromFactory(bucketFactory BucketFactory) *Leaky { tomb: bucketFactory.tomb, wgPour: bucketFactory.wgPour, wgDumpState: bucketFactory.wgDumpState, + labels: bucketFactory.Labels, mutex: &sync.Mutex{}, } if l.BucketConfig.Capacity > 0 && l.BucketConfig.leakspeed != time.Duration(0) { diff --git a/pkg/leakybucket/overflows.go b/pkg/leakybucket/overflows.go index 3a7732aa6..2c437d252 100644 --- a/pkg/leakybucket/overflows.go +++ b/pkg/leakybucket/overflows.go @@ -265,6 +265,7 @@ func NewAlert(leaky *Leaky, queue *Queue) (types.RuntimeAlert, error) { StartAt: &startAt, StopAt: &stopAt, Simulated: &leaky.Simulated, + Labels: &leaky.labels, } if leaky.BucketConfig == nil { return runtimeAlert, fmt.Errorf("leaky.BucketConfig is nil")