app/vminsert/influx: properly handle the case when certain labels with empty values are removed by ApplyRelabeling() call

Previously this could lead to `out of range` panic
This commit is contained in:
Aliaksandr Valialkin 2020-07-17 00:05:08 +03:00
parent 14dc426b45
commit f9b38f7f2d

View file

@ -120,7 +120,7 @@ func insertRows(at *auth.Token, db string, rows []parser.Row, mayOverrideAccount
}
labels = ic.Labels
if !hasRelabeling {
labels = labels[labelsLen : labelsLen+1]
labels = labels[len(labels)-1:]
}
ic.MetricNameBuf = ic.MetricNameBuf[:metricNameBufLen]
for i := range labels {