diff --git a/src/features/device-logs/lib/backends/loki.ts b/src/features/device-logs/lib/backends/loki.ts index 7ad2cfa0b..9088cea2f 100644 --- a/src/features/device-logs/lib/backends/loki.ts +++ b/src/features/device-logs/lib/backends/loki.ts @@ -379,6 +379,7 @@ export class LokiBackend implements DeviceLogsBackend { ctx: LogContext, logs: Array, ) { + const structuredMetadata = this.getStructuredMetadata(ctx); return logs.map((log) => { const timestamp = new loki.Timestamp(); timestamp.setSeconds(Math.floor(Number(log.nanoTimestamp / 1000000000n))); @@ -388,7 +389,6 @@ export class LokiBackend implements DeviceLogsBackend { { ...log, version: VERSION }, omitNanoTimestamp, ); - const structuredMetadata = this.getStructuredMetadata(ctx); // create entry with labels, line and timestamp return new loki.EntryAdapter() .setLine(logJson)