diff --git a/mqtt2prom/run b/mqtt2prom/run index b2fb580..d5a0c6e 100755 --- a/mqtt2prom/run +++ b/mqtt2prom/run @@ -85,13 +85,17 @@ $mqtt->onMessage(function ($message) use ( $payload["timestamp"] = time(); $data[] = $payload; $news = true; + $v = []; + foreach ($$payload["labels"] as $key => $value) { + $v[] = $key . "=" . $value; + } logit( "got message for " . $payload["name"] . ": " . implode(", ", $payload["labels"]) . " with value " . - $payload["value"] + implode(", ", $v) ); });