Sparkplug plugin doesn't decode metrics of type 'b...
# umh-support
s
The current Sparkplug plugin does not decode metrics of type 'bytes'. Please find a patch in attachment with a test that exposes this bug.
r
I will ask Aaron to check this.
a
Thanks for reporting. I am working on resolving the bug and will will update you!
s
It turns out there is something else going on to. At some point in history we've decided to use extensions. Now we use metric.byte_value to send a stream of bytes, but with a metric.datatype=29. Current Sparkplug plugin implementation 1. doesn't use value of bytes_value, it return nill. 2. it returns 'Unknown' for datatypes defined in the extension.proto. For point two could we have the plugin return "29" for datatype=29? Then at least client code can act according to the custom datatype. Now I have to use the metric's name to decode data.
Drop request for point 2. If spb_datatype": "Unknown" I can check spb_metric_decoded.datatype.
a
For point 1: I am working on a pull request for the fix at the moment. We will then also make sure to log a warning if the data point can't be decoded. For point 2: True that should be a valid workaround if decode_extension is configured
We now merged a PR that should allow you to also decode metrics of the type byte properly. Further we also included now warnings per matric name if something cannot be decoded https://github.com/united-manufacturing-hub/benthos-umh/pull/480 It should be in the release soon. Feel free to try it out and give us feedback!