From c0dfee8439156dca9abb92d4da3ff8861a0cc737 Mon Sep 17 00:00:00 2001 From: perf3ct Date: Tue, 15 Jul 2025 20:39:36 +0000 Subject: [PATCH] fix(metrics): don't assign a timestamp to Prometheus metrics, let the scraper assign the timestamp to the time series --- apps/server/src/etapi/metrics.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/server/src/etapi/metrics.ts b/apps/server/src/etapi/metrics.ts index 972a6e4e7..d46026647 100644 --- a/apps/server/src/etapi/metrics.ts +++ b/apps/server/src/etapi/metrics.ts @@ -43,7 +43,6 @@ interface MetricsData { */ function formatPrometheusMetrics(data: MetricsData): string { const lines: string[] = []; - const timestamp = Math.floor(new Date(data.timestamp).getTime() / 1000); // Helper function to add a metric const addMetric = (name: string, value: number | null, help: string, type: string = 'gauge', labels: Record = {}) => { @@ -56,7 +55,7 @@ function formatPrometheusMetrics(data: MetricsData): string { ? `{${Object.entries(labels).map(([k, v]) => `${k}="${v}"`).join(',')}}` : ''; - lines.push(`${name}${labelStr} ${value} ${timestamp}`); + lines.push(`${name}${labelStr} ${value}`); lines.push(''); };