Open zdzichu opened 6 months ago
The Problem with the current streaming plugins is that you can't send back series with refid's.
We just send each received message on the same query so /all/#
results into a big map of values. Because the values do not arrive at the same time you see undefined and null values.
Example:
query: /all/#
--> first message on the subscription from /all/device1
with data {"value1": 123}
will be stored into the messages array.
messages: [{"value1": 123}]
--> second message on the subscription from /all/device2
with data {"value2": 32.1}
will be stored into the messages array.
messages: [{"value1": 123}, {"value2": 32.1}]
Grafana will create a row for each array index resulting in:
Value1 | Value2 |
---|---|
32.1 | |
123 |
where all empty fields will be replaced with undefined/null
Sorry for not being clear enough. If I specify topic as /all/device1
or /all/device2
then nothing will be received by Grafana. At least it looks like so, but:
Specifying #
was to illustrate that data is in fact received.
Oh, and those topic receive integer or float values, not a JSON.
Ok now i got it.
So it seems none json value support is needed and a fix that topics can start with a /
Hi,
I'm aware there are multitude "does not work"-kind issues already reported, but I believe I'm providing enough data to improve the datasource.
I'm using version v1.0.0-beta.4 with grafana-10.2.6.
I see two issues:
/
seem to be ignored. This may be related with how the key for topic is created, by path-concatenating duration and the actual topic. I also noted, that intopic_test.go
there are not tests for a topic starting with a slashI was able to capture some traffic in Grafana Explorer by subscribing to
__HASH__
. At the same time I was runningmosquitto_sub
on this topic. Here are the results:This what was being sent:
And this is what MQTT datasource was able to understand:
Observation:
null
/undefined
rtl_433
(note: no leading slash) no value was correctly parsed/shelly02/events/rpc
some fields were interpreted, but also got duplicated (?)/shelly02/status/switch:0
some field were interpreted, too