Skip to content

Commit

Permalink
fix: add null check to exemplar data (thanos-io#5202)
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Mota <tmm@danskecommodities.com>
  • Loading branch information
tomasmota authored and matej-g committed Mar 18, 2022
1 parent 6266ce7 commit 6b80a50
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/exemplars/exemplars.go
Expand Up @@ -89,6 +89,10 @@ func (rr *GRPCClient) Exemplars(ctx context.Context, req *exemplarspb.ExemplarsR
return nil, nil, errors.Wrap(err, "proxy Exemplars")
}

if resp.data == nil {
return make([]*exemplarspb.ExemplarData, 0), resp.warnings, nil
}

resp.data = dedupExemplarsResponse(resp.data, rr.replicaLabels)
return resp.data, resp.warnings, nil
}
Expand Down

0 comments on commit 6b80a50

Please sign in to comment.