grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
309 stars 199 forks source link

Location and metric in different datasources #176

Open erlfos opened 5 years ago

erlfos commented 5 years ago

Hi I love the worldmap panel, and we find it very useful. We are now trying to use the worldmap panel to show metrics from basestations, but the basestation metrics and the location (long,lat) is in different datasources (MySQL for location and InfluxDB for metrics). I manage to combine the two queries to get a table panel with the metrics, long, lat, a Site ID (used for Location Name Field in World Map) from the MySQL DB, metrics from the InfluxDB and a LNBTS field used to combine the two queries into one table (it is found in both the MySQL DB and the InfluxDB): image image

In the World Map panel I can only manage to show the basestation locations if I insert a bogus metric value in the SQL query (I tried to use the same queries as above). World Map panel does not use the metric value in the InfluxDB query as I had hoped. I guess World Map panel was not intended to be used in this way (separate datasources for location and metric), but I wonder if there might be a way around this problem?

amotl commented 4 years ago

Dear @erlfos,

thanks for writing in. Currently, Worldmap probably does not support the use case you are asking for. It will happily accept a single query, but probably not two of them, see #230.

However, you might be able to export the list of stations into a JSON resource and use this one for mapping the locations while querying the metric values from InfluxDB. I believe this is the current way to map things within Worldmap.

@exit2escritical probably asked for the same thing within #203, and we answered:

As we have have been able to make ourselves reasonably familiar with the code base in the course of #177 which finally dragged us into #197 and in turn led to the creation of Grafana Map Panel NG the other day, we will be happy to put this on our agenda as well if there's enough interest in the community for a functionality like that which seems to be missing.

After the refactoring, I believe the refurbished code base [1] will now be ready to carry some more features again.

With kind regards, Andreas.

[1] https://github.com/panodata/grafana-map-panel