diff --git a/metrics_batcher.go b/metrics_batcher.go index 54a92e9..3b8bb3c 100644 --- a/metrics_batcher.go +++ b/metrics_batcher.go @@ -52,7 +52,7 @@ func (mb *metricsBatcher) addTimeSeries(ts *monitoringpb.TimeSeries) { Name: monitoring.MetricProjectPath(mb.projectID), TimeSeries: mb.allTss, }) - mb.allTss = make([]*monitoringpb.TimeSeries, maxTimeSeriesPerUpload) + mb.allTss = make([]*monitoringpb.TimeSeries, 0, maxTimeSeriesPerUpload) } }