Skip to content

Commit

Permalink
[exporter/datadogexporter] Skip nil sketches (#5925)
Browse files Browse the repository at this point in the history
  • Loading branch information
mx-psi authored Oct 26, 2021
1 parent 67e165e commit 752067e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,10 @@ func (t *Translator) getSketchBuckets(

}

consumer.ConsumeSketch(ctx, name, ts, as.Finish(), tags, host)
sketch := as.Finish()
if sketch != nil {
consumer.ConsumeSketch(ctx, name, ts, sketch, tags, host)
}
}

func (t *Translator) getLegacyBuckets(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,9 +512,6 @@ type mockFullConsumer struct {
}

func (c *mockFullConsumer) ConsumeSketch(_ context.Context, name string, ts uint64, sk *quantile.Sketch, tags []string, host string) {
if sk == nil {
return
}
c.sketches = append(c.sketches,
sketch{
name: name,
Expand Down

0 comments on commit 752067e

Please sign in to comment.