From 8c14ca93fab6d41fe02da063a6f82e9ca24922d2 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 17 Jul 2020 00:05:08 +0300 Subject: [PATCH] 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 --- app/vminsert/influx/request_handler.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/vminsert/influx/request_handler.go b/app/vminsert/influx/request_handler.go index e7e4ef53a..35fc2d3d8 100644 --- a/app/vminsert/influx/request_handler.go +++ b/app/vminsert/influx/request_handler.go @@ -105,7 +105,7 @@ func insertRows(db string, rows []parser.Row) error { } labels := ic.Labels if !hasRelabeling { - labels = labels[labelsLen : labelsLen+1] + labels = labels[len(labels)-1:] } ic.WriteDataPoint(ctx.metricNameBuf, labels, r.Timestamp, f.Value) }