Giter Site home page Giter Site logo

Grafana won't display different topics from MQTT data source in the same panel with distinct field value name about mqtt-datasource HOT 4 OPEN

grafana avatar grafana commented on May 31, 2024 3
Grafana won't display different topics from MQTT data source in the same panel with distinct field value name

from mqtt-datasource.

Comments (4)

gpinkos avatar gpinkos commented on May 31, 2024 2

This is the transformation (outer join + organize fields) that I used to distinguish the different fields:

image

from mqtt-datasource.

andershz avatar andershz commented on May 31, 2024

I have noticed the same thing, although I have 20 topics, not 2, and I use gauges instead of timelines.
I assume the topics you subscribe to publish simple numeric values, not json objects.
In that case it is by (lack of) design they are all mapped to the field name "Value".
I tried to solve this by adding field overrides, mapping "Fields returned by query" to "Display name".
That did not work so well in practice, it was very hard to configure it since fields appeared and disappeared in the
"Fields returned by query"-dropdown in a seemingly random manor.
In the end I got all 20 fields configured by manually modifying the panel json.
But even then it did not work very well, metrics would frequently revert back to being displayed as "Value" until the page was reloaded in the browser.
What I did then was to modify the backend code so that when the payload is a single value rather than a json object it will be sent to the frontend using the topic as field name instead of "Value".
In cases where I don't want the MQTT topic as display name I can just add a field override mapping "Fields with name" to "Display name". That seems to be stable unlike the mapping from "Fields returned by query".

Another thing that you might not have noticed with just 2 topics is that you are probably missing every second update to each topic.
I found that when using N topics in the same dashboard, (or rather with the same MQTT data source), for each topic only every 1/N update is sent from backend to frontend. This is more visible when using many topics as I do.
I had to modify the backend code to fix that as well.

from mqtt-datasource.

Buronn avatar Buronn commented on May 31, 2024

This still not working for me, I have two topics (light/1 and light/2) and both needs to be separated, I can't mix them.

from mqtt-datasource.

shinton-ps avatar shinton-ps commented on May 31, 2024

I've found this to be an issue since before the official beta release, but the latest beta release broke all of my dashboards. In my case my topics are comprised of multiple values, e.g.

{
    "value1": 1.234
    "value2": 5.678
    ...
}

With the latest beta release my data drops out after only a few seconds (publishing at 5 Hz). Sometimes it's one topic, sometimes it's both. Sometimes I can get one back by changing the time range or refreshing the page, but then it drops out again soon after.

from mqtt-datasource.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.