From 05c496e2a8150573513f2574cfef1407de96a72b Mon Sep 17 00:00:00 2001 From: Ivana Date: Tue, 15 Dec 2020 12:20:14 +0100 Subject: [PATCH] Store prev response uids in usedUids --- public/app/plugins/datasource/loki/result_transformer.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/public/app/plugins/datasource/loki/result_transformer.ts b/public/app/plugins/datasource/loki/result_transformer.ts index 8a462a2214f..e49eddcae12 100644 --- a/public/app/plugins/datasource/loki/result_transformer.ts +++ b/public/app/plugins/datasource/loki/result_transformer.ts @@ -130,8 +130,11 @@ export function appendResponseToBufferedData(response: LokiTailResponse, data: M const labelsField = data.fields[3]; const idField = data.fields[4]; - // We need to store and track all used uids to ensure that uids are unique - const usedUids: { string?: number } = {}; + // We need to store and track all used uids (from current response, but also data) to ensure that uids are unique + const usedUids: { string?: number } = idField.values.toArray().reduce((obj, uid) => { + obj[uid] = 0; + return obj; + }, {}); for (const stream of streams) { // Find unique labels