File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ package cgroups
2020
2121import (
2222 "context"
23- "errors"
2423 "fmt"
2524 "sync"
2625
@@ -33,13 +32,6 @@ import (
3332 "github.com/prometheus/client_golang/prometheus"
3433)
3534
36- var (
37- // ErrAlreadyCollected is returned when a cgroups is already being monitored
38- ErrAlreadyCollected = errors .New ("cgroup is already being collected" )
39- // ErrCgroupNotExists is returns when a cgroup no longer exists
40- ErrCgroupNotExists = errors .New ("cgroup does not exist in the collector" )
41- )
42-
4335// Trigger will be called when an event happens and provides the cgroup
4436// where the event originated from
4537type Trigger func (string , string , cgroups.Cgroup )
@@ -141,7 +133,7 @@ func (c *collector) Add(t runtime.Task) error {
141133 defer c .mu .Unlock ()
142134 id := taskID (t .ID (), t .Namespace ())
143135 if _ , ok := c .tasks [id ]; ok {
144- return ErrAlreadyCollected
136+ return nil // requests to collect metrics should be idempotent
145137 }
146138 c .tasks [id ] = t
147139 return nil
You can’t perform that action at this time.
0 commit comments