From c31d640eb98ac14eeb878bd68e9b013351384c3a Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Tue, 3 Mar 2020 15:00:52 +0200 Subject: [PATCH] app/vmagent/remotewrite: do not reset empty relabelCtx --- app/vmagent/remotewrite/remotewrite.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/vmagent/remotewrite/remotewrite.go b/app/vmagent/remotewrite/remotewrite.go index 1bbcfd492..81279e60d 100644 --- a/app/vmagent/remotewrite/remotewrite.go +++ b/app/vmagent/remotewrite/remotewrite.go @@ -106,7 +106,9 @@ func Push(wr *prompbmarshal.WriteRequest) { for _, rwctx := range rwctxs { rwctx.Push(tssBlock) } - rctx.reset() + if rctx != nil { + rctx.reset() + } } if rctx != nil { putRelabelCtx(rctx)