add labels
This commit is contained in:
parent
e46ca38cbb
commit
ee58a9aefb
2 changed files with 3 additions and 0 deletions
|
@ -70,6 +70,7 @@ type Leaky struct {
|
||||||
wgPour *sync.WaitGroup
|
wgPour *sync.WaitGroup
|
||||||
wgDumpState *sync.WaitGroup
|
wgDumpState *sync.WaitGroup
|
||||||
mutex *sync.Mutex //used only for TIMEMACHINE mode to allow garbage collection without races
|
mutex *sync.Mutex //used only for TIMEMACHINE mode to allow garbage collection without races
|
||||||
|
labels map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
var BucketsPour = prometheus.NewCounterVec(
|
var BucketsPour = prometheus.NewCounterVec(
|
||||||
|
@ -177,6 +178,7 @@ func FromFactory(bucketFactory BucketFactory) *Leaky {
|
||||||
tomb: bucketFactory.tomb,
|
tomb: bucketFactory.tomb,
|
||||||
wgPour: bucketFactory.wgPour,
|
wgPour: bucketFactory.wgPour,
|
||||||
wgDumpState: bucketFactory.wgDumpState,
|
wgDumpState: bucketFactory.wgDumpState,
|
||||||
|
labels: bucketFactory.Labels,
|
||||||
mutex: &sync.Mutex{},
|
mutex: &sync.Mutex{},
|
||||||
}
|
}
|
||||||
if l.BucketConfig.Capacity > 0 && l.BucketConfig.leakspeed != time.Duration(0) {
|
if l.BucketConfig.Capacity > 0 && l.BucketConfig.leakspeed != time.Duration(0) {
|
||||||
|
|
|
@ -265,6 +265,7 @@ func NewAlert(leaky *Leaky, queue *Queue) (types.RuntimeAlert, error) {
|
||||||
StartAt: &startAt,
|
StartAt: &startAt,
|
||||||
StopAt: &stopAt,
|
StopAt: &stopAt,
|
||||||
Simulated: &leaky.Simulated,
|
Simulated: &leaky.Simulated,
|
||||||
|
Labels: &leaky.labels,
|
||||||
}
|
}
|
||||||
if leaky.BucketConfig == nil {
|
if leaky.BucketConfig == nil {
|
||||||
return runtimeAlert, fmt.Errorf("leaky.BucketConfig is nil")
|
return runtimeAlert, fmt.Errorf("leaky.BucketConfig is nil")
|
||||||
|
|
Loading…
Reference in a new issue