grafana / worldmap-panel

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

Cannot query correct map data on Grafana Worldmap plugin? #273

Closed sammijosammijo closed 3 years ago

sammijosammijo commented 3 years ago

I am new to Grafana and am trying to create a Grafana dashboard that shows the location of tracked objects and want to use the worldmap plugin.

I have a postgreSQL database that has the following columns: marking (text) id (text), primary key latitude (double) longitude (double) altitude (double) last observed time (timestamp with time zone) source (text)

Here is the query I am making. I am not getting any errors, but no points are showing up, either. I want to have a map with points that show the number of hours since they were last observed:

SELECT lastobtime as time, id AS metric, EXTRACT(epoch FROM (CURRENT_TIMESTAMP - lastobtime) / 3600) as value, lat as latitude, lon as longitude, id as name FROM sensor WHERE $__timeFilter(lastobtime) ORDER BY lastobtime, source;

I have tried formatting the query as both a Time Series and a Table with no luck. No errors when it is a time series, but get the error "Cannot read property 'length' of undefined" when it is a Table.

How can I fix my query to get the points to show up on the map?