Skip to content

Commit

Permalink
rotor: increase metrics date key resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
absorbb committed Jan 28, 2025
1 parent e3cea99 commit 83fd7f7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/rotor/src/lib/metrics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ export function createMetrics(
continue;
}
const d = el.receivedAt || new Date();
const epochTime = d.getTime();
d.setMilliseconds(0);
d.setSeconds(0);
// console.log(
Expand All @@ -184,7 +185,7 @@ export function createMetrics(
return prefix + status;
})(el);
buffer.push({
key: el.metricsMeta.messageId + "_" + el.eventIndex + "_" + (el.receivedAt || new Date()).getTime(),
key: el.metricsMeta.messageId + "_" + el.eventIndex + "_" + epochTime,
timestamp: d,
...omit(el.metricsMeta, "retries"),
functionId: el.functionId,
Expand Down

0 comments on commit 83fd7f7

Please sign in to comment.