From d608bdc2f46320cfbc596b3f87667028f9b8f2c9 Mon Sep 17 00:00:00 2001 From: Dirk Heilig Date: Thu, 29 Aug 2024 10:46:16 +0200 Subject: [PATCH] sort labels by key --- mqtt2prom/run | 1 + 1 file changed, 1 insertion(+) diff --git a/mqtt2prom/run b/mqtt2prom/run index 797d89c..4a3fcc7 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -252,6 +252,7 @@ function output(): void foreach ($filteredData as $entry) { $labels = []; if (isset($entry["labels"])) { + ksort($entry["labels"]); foreach ($entry["labels"] as $labelName => $labelValue) { $labels[] = "$labelName=" .