-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support complex MQTT Payloads #8
Comments
Currently the plugin supports simple values ie "555" or a simple map[string]number -- we should be able to support a more complex shape |
Thanks! The no-data was solved by setting a low timerange, like 5 mins. I used it in an existing dashboard which defaulted to 30d. |
I'm new to grafana. Could you give more specific examples of the what the data should look like (i.e. what does map[string]number mean?) . I can generate data points with |
currently we support very basic JSON structures like:
notice how the key is we do plan to bring support for more complex JSON structures soon (contributions are always welcome too 🙂) as far as the timestamp is concerned currently we just naively use mqtt-datasource/pkg/mqtt/client.go Line 98 in 46b6178
however i do agree we should have a way to set that based on the incoming message in cases where the data is delayed and needs a timestamp on the publisher side to be propagated. any suggestions on this? |
Thanks for the detailed reply. I'm currently sending just raw data. Once I understand more about Grafana I'll try out your more complex json payload and recommend how time might be encoded. Re: contributions your typescript and go code (and how they interact) is beyond me at this point (I'm a C++/Java/Python guy). |
support for more data types with the JSON payload would be super handy as part of this enhancement, see: #19 |
Hi @atifali, How do you plan to support more complex json? will that be arbitrary json? Do you have plans to support timestamps that are part of the MQTT message? This has caught my attention, I think it is awesome: https://grafana.com/blog/2021/08/12/streaming-real-time-sensor-data-to-grafana-using-mqtt-and-grafana-live/ But we can currently not use it, because our json is more complex and also subject to change. |
Hi @rafaelschlatter really appreciate your enthusiasm and patience with this. We are currently in the midst of incorporating a very versatile and flexible automatic JSON processor within Live "pipelines" in Grafana core (see: https://github.com/grafana/grafana/tree/main/pkg/services/live/pipeline), which will eventually be used here. This means that virtually any message that has a valid JSON format would work. Stay tuned! |
Sounds awesome, thanks for the update, @atifali ! |
@rafaelschlatter that sounds awesome, nice work! |
Any news on this? There is an open pull request #22 |
Hello, what is the status for the integration of the Live "pipelines" JSON processor in mqtt-datasource? Do you have any news? thanks and have a good day. |
One idea about complex mqtt payloads would be to implement something like what Amazon did for the rules processing feature of IoT Core. Essentially, it allows you to use a language very close to SQL to "select" data out of a JSON object of arbitrary structure and depth, pull out the data you want, rename the fields, and do some basic math on them. Some of what they do probably wouldn't be necessary here (I don't think you really need WHERE clauses, for example). |
Sorry, which the state of this integration? I tried to understand it by clicking on the various links: closed, enhancement, open .... |
@atifali Hello, What is the status of this? Thanks |
Any progress on this? |
Hello!
Nice plugin. Can you please update the documentation with information on how to format the payload?
No matter what I try, all I get is "Data does not have a time field"
Can I have complex objects with multiple values? Can I instruct it to parse the json?
E.g
Thanks!
The text was updated successfully, but these errors were encountered: