Skip to content

Commit

Permalink
remove reference to metrics after reslicing
Browse files Browse the repository at this point in the history
Signed-off-by: Dima Kozlov <hummerd@mail.ru>
  • Loading branch information
Dima Kozlov committed Jul 22, 2020
1 parent d3accfd commit 0c48254
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions prometheus/vec.go
Expand Up @@ -276,7 +276,9 @@ func (m *metricMap) deleteByHashWithLabelValues(
}

if len(metrics) > 1 {
old := metrics
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
old[len(old)-1] = metricWithLabelValues{}
} else {
delete(m.metrics, h)
}
Expand All @@ -302,7 +304,9 @@ func (m *metricMap) deleteByHashWithLabels(
}

if len(metrics) > 1 {
old := metrics
m.metrics[h] = append(metrics[:i], metrics[i+1:]...)
old[len(old)-1] = metricWithLabelValues{}
} else {
delete(m.metrics, h)
}
Expand Down

0 comments on commit 0c48254

Please sign in to comment.