Skip to content

Commit

Permalink
Loki: reduce unnecessary recreation of structured metadata
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
Page- committed Dec 20, 2024
1 parent 59ec973 commit e91957a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/features/device-logs/lib/backends/loki.ts
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@ export class LokiBackend implements DeviceLogsBackend {
ctx: LogContext,
logs: Array<DeviceLog & { version?: number }>,
) {
const structuredMetadata = this.getStructuredMetadata(ctx);
return logs.map((log) => {
this.validateLog(log);
const timestamp = new loki.Timestamp();
Expand All @@ -408,7 +409,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)
Expand Down

0 comments on commit e91957a

Please sign in to comment.