kpetremann / mqtt-exporter

Simple generic MQTT Prometheus exporter for IoT working out of the box
https://hub.docker.com/r/kpetrem/mqtt-exporter
MIT License
108 stars 30 forks source link

Added functionality to extract metric name and labels from topic #35

Closed ViKozh closed 2 years ago

ViKozh commented 2 years ago

I've implemented functionality to extract additional data from topic (labels and metric identifier) by using regular expression. This addition can be useful with ESPHome MQTT client 'cause it generate topics that ends with 'state' for every sensor. Also it has parametrized topic prefix that can be used to extract additional labels for metric, i.e. location, device type etc.

ViKozh commented 2 years ago

Sorry. Found possible bug with this request trying to run within docker.