Skip to content

Commit

Permalink
Skip processing empty metric slice in Stackdriver exporter (#1494)
Browse files Browse the repository at this point in the history
  • Loading branch information
nilebox authored Nov 5, 2020
1 parent 95011c7 commit 507ad41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exporter/stackdriverexporter/stackdriver.go
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ func (me *metricsExporter) pushMetrics(ctx context.Context, m pdata.Metrics) (in

mds := internaldata.MetricsToOC(m)
for _, md := range mds {
if len(md.Metrics) == 0 {
continue
}

points := numPoints(md)
dropped, err := me.mexporter.PushMetricsProto(ctx, md.Node, md.Resource, md.Metrics)
recordPointCount(ctx, points-dropped, dropped, err)
Expand Down

0 comments on commit 507ad41

Please sign in to comment.