Map JSON properties as MQTT labels#172
Conversation
| return func(topic string, payload []byte, deviceID string) (MetricCollection, error) { | ||
| var mc MetricCollection | ||
| parsed := gojsonq.New(gojsonq.SetSeparator(p.separator)).FromString(string(payload)) | ||
| rawPayload := gojsonq.New(gojsonq.SetSeparator(p.separator)).FromString(string(payload)) |
There was a problem hiding this comment.
Rather than parse the raw data again, can we avoid cloning altogether or at least clone the object without deserializing again?
|
I should probably update the README to include this new feature, as well :) |
|
Here's a pre-built package for your use https://github.com/SuperCoolAlan/mqtt2prometheus/pkgs/container/mqtt2prometheus |
|
When sharing the same topic and inheriting labels, no new Prometheus measurement is posted to |
Implements the feature requested here: #74