From ab70fbe987cba39373507feae92dc2bff256ee82 Mon Sep 17 00:00:00 2001 From: Thiago Padilha Date: Thu, 5 Oct 2023 14:40:58 -0300 Subject: [PATCH] Fix metrics Signed-off-by: Thiago Padilha --- packages/frontend/hooks/useFluentBitStream.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/frontend/hooks/useFluentBitStream.ts b/packages/frontend/hooks/useFluentBitStream.ts index 7a87e795..2dfe6c4b 100644 --- a/packages/frontend/hooks/useFluentBitStream.ts +++ b/packages/frontend/hooks/useFluentBitStream.ts @@ -38,7 +38,11 @@ async function fetchStream(vivoExporterUrl: string, kind: StreamKind, lastId: nu continue; } const record = JSON.parse(line) - records.push({ record, rawEvent: JSON.stringify(record[1]), rawMetadata: JSON.stringify(record[0][1]), id: id-- }); + if (Array.isArray(record)) { + records.push({ record, rawEvent: JSON.stringify(record[1]), rawMetadata: JSON.stringify(record[0][1]), id: id-- }); + } else { + records.push({ record, id: id-- }); + } } return records }