Skip to content

Commit

Permalink
fix: sg collector throws NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulguptajss committed Sep 28, 2023
1 parent b025ed6 commit 0749226
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/matrix/matrix.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ func (m *Matrix) Clone(with With) *Matrix {
clone.globalLabels = m.globalLabels
clone.exportOptions = m.exportOptions
clone.exportable = m.exportable
clone.displayMetrics = make(map[string]string)

if with.Instances {
clone.instances = make(map[string]*Instance, len(m.GetInstances()))
Expand All @@ -94,7 +95,6 @@ func (m *Matrix) Clone(with With) *Matrix {

if with.Metrics {
clone.metrics = make(map[string]*Metric, len(m.GetMetrics()))
clone.displayMetrics = make(map[string]string)
for key, metric := range m.GetMetrics() {
c := metric.Clone(with.Data)
clone.metrics[key] = c
Expand Down

0 comments on commit 0749226

Please sign in to comment.