Svedrin / mqtt-pushgateway

Prometheus Exporter for metrics received via MQTT
15 stars 10 forks source link

Support json messages #1

Closed tom-henderson closed 4 years ago

tom-henderson commented 4 years ago

Adds support for extracting multiple metrics from a JSON formatted message.

eg for a JSON payload {"temperature":29.02,"linkquality":34,"humidity":55.58,"battery":100,"voltage":3005}

create multiple metrics like:

temperature{topic="zigbee2mqtt/sensor/lounge/xiaomi/WSDCGQ01LM"} 29.300000
linkquality{topic="zigbee2mqtt/sensor/lounge/xiaomi/WSDCGQ01LM"} 34.000000
humidity{topic="zigbee2mqtt/sensor/lounge/xiaomi/WSDCGQ01LM"} 54.700000
battery{topic="zigbee2mqtt/sensor/lounge/xiaomi/WSDCGQ01LM"} 100.000000
voltage{topic="zigbee2mqtt/sensor/lounge/xiaomi/WSDCGQ01LM"} 3005.000000
tom-henderson commented 4 years ago

Thanks, I've fixed up the readme and it looks like you've already fixed the rest. I think this is ready to merge.

Svedrin commented 4 years ago

@tom-henderson thanks! :)