From 7db2046042cf7d057b9cca327a4d2143cf8412a1 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Wed, 14 Aug 2024 16:36:13 +0200 Subject: [PATCH] ommit timestamp for now --- mqtt2prom/run | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mqtt2prom/run b/mqtt2prom/run index b596b62..b7a263a 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -238,8 +238,8 @@ function output(): void $labels . " " . $entry["value"] . - #" " . - #$entry["timestamp"] . + " " . + $entry["timestamp"] . "\n"; } file_put_contents("/www/metrics/new.prom", $prom); @@ -251,7 +251,7 @@ function filter(): void { global $data, $stats; $data = array_filter($data, function ($entry) { - return $entry["timestamp"] > time() - 5 * 60; // 5 min is the hardcoded value in prometheus + return $entry["timestamp"] > time() - 60; }); // remove stats older than 24h foreach ($stats as $key => $values) {