diff --git a/sdk/metric/controller/push/push.go b/sdk/metric/controller/push/push.go index b6aabe6dfdc..a039205df57 100644 --- a/sdk/metric/controller/push/push.go +++ b/sdk/metric/controller/push/push.go @@ -33,7 +33,6 @@ const DefaultPushPeriod = 10 * time.Second // Controller organizes a periodic push of metric data. type Controller struct { lock sync.Mutex - collectLock sync.Mutex accumulator *sdk.Accumulator resource *resource.Resource uniq metric.MeterImpl @@ -157,8 +156,8 @@ func (c *Controller) tick() { // TODO: either remove the context argument from Export() or // configure a timeout here? ctx := context.Background() - c.collectLock.Lock() - defer c.collectLock.Unlock() + c.integrator.Lock() + defer c.integrator.Unlock() c.accumulator.Collect(ctx) diff --git a/sdk/metric/integrator/simple/simple.go b/sdk/metric/integrator/simple/simple.go index 8037f7650fe..8712e34b1f8 100644 --- a/sdk/metric/integrator/simple/simple.go +++ b/sdk/metric/integrator/simple/simple.go @@ -28,8 +28,8 @@ import ( type ( Integrator struct { export.AggregationSelector - batch batch stateful bool + batch } batchKey struct {