Worldmap with influx db

Hello,
I try to use grafana world map plugin to display data from influx.
dashboard is visible at: http://bolge.vps.webdock.cloud:3000/d/1FHI8WnVz/tides?orgId=1

example data from influxdb:

select * from tide limit 1
name: tide
time Z0 geohash lat latitude level lon longitude referenceLevel siteName


1662854400000000000 67.9 cm u4kp6ruw3mxg 58.974339 58.974339 25.9 5.730121 5.730121 MSL (Mean Sea Level (1996-2014)) ANX

I tried to use markers, tried to customize it, but it did not worked. Documentation is not helpful in this case.
I was trying to add geohash, lat and lot as floats, also store it under long names (latitude and longitude).

its very frustrating to use the plugin.

Welcome

Please post your data as inline csv
Like so

Lon,lat
45.5,-61.2

it is already inline, just comma is missing, but its obvious to read, but i can even simplifiy it:

timestamp, level, geohash, lat, lon ​

​​1662854400000000000, 67.9, u4kp6ruw3mxg, 58.974339, 5.730121

or

timestamp, level, geohash, latitude, longitude ​

​​1662854400000000000, 67.9, u4kp6ruw3mxg, 58.974339, 5.730121

I tired with many combinations. That’s example just to make this plugin show any data.

1 Like

data can also be accessed by:
http://bolge.vps.webdock.cloud:3000/d/1FHI8WnVz/tides?orgId=1&inspect=4&inspectTab=data

as i said, not displaying any position

Taak. Here it is using flux query language and not influxql

from(bucket: "tides")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "tides")
  |> filter(fn: (r) => r["_field"] == "lat" or r["_field"] == "level" or r["_field"] == "lon")
  |> filter(fn: (r) => r["geo"] == "S")
  |> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
  |> group()  
  |> drop(columns: ["_start", "_stop", "_measurement"])

First of all - if it is really taking flux not querry language - the the default values are super confusing. The “brand new” querry field looks like below: (if the hint is misleading, then…)

second - I do not know the flux, howver if I copy (and tyr to modify) I end up with 500 internal server error anyway. I try to figure out now why…

here more details *red)

my database is InfluxDB … i will try to figure out how to use flex to querry it and if its possible…

Even after enabling Flux:

and resetting influx service -


Flux querries seem not accepted - I also tried to use them in influx cli - but cli seemed to expect standard influx querry language. I try to dig through documenation agan…
hoping to find as usual “magic” word that unless you know it you will not easily guess…
but my whole experience with grafana is basically “hacking” :frowning:

disagree with you on “hacking”, like all things it is a matter of time to get our heads wrapped around the issue. here is the influxql query.

SELECT "lat", "lon", "level" FROM "tides"

image

image

I work with grafana and influx for 4 years now. Lots of things really need to be figured out. I can go on with a list really long. i keep a page with all the “hacks” ("how to make things work).
Devops team I work with recently decided they will try sql since they got really frustrated with influx…
I checked up flux - and at this point - I need to stop here because I am not sure if I want to put that much time and effort into configuring the flux part (you need to add the whole data source, configure buckets and so on).
Your examples are tiny part of screenshots out of context for me. For instance information that the plugin works with InfluxDB but spports Flux only would save me many hours that I wasted on trying to make it work with querry language.
Thank you for help, but at this point i need to step back and evaluate if I want to spend even more time to something that should be just a simple prototype for me.

1 Like

You are welcome and happy journey
It took me 10 minutes to put your data into influx and geo map it

For a simple prototype I would go with infinity with your data as csv. This is just for POC though give me 5 minutes

the screen shot is based on tiny example of data you provided.

Overall, it does not sound you have positive vibes about your experience with grafana. I believe it is a cool tool and the community can help you for you to have a positive experience.

1 Like

You forgot to type how much time you took you to learn flux.
Once when somebody knows the technology, things are easy, but especially IT ppl, living in their own bubles forget that it takes time and pain to learn things.

grafana is not a bad tool. But there are same problems like any other new technology. It is not really well thought trough. Its internal logic is sometimes not very consistent. Like any tools that develops too fast - it pays the price with consistency and some kind of predictable, consitent logic. In short - many technologies lack meturity and some consistent, clean “logic.”

Lots of truth in what you say there. Hence the reason I am taking time out to help you by coming out of my bubble.

Still learning flux but took me couple of weeks of dedicated time.

Basically I just learnt it last few months.

If you are willing happy to help you. Otherwise happy journey

Thank you. Where I work we needed spend time and effort to show to users (c++ developes) how to use the dashboards. Things that were obvious for us, were not obvious for them. What I was doing I was simply sitting next to them or asking them to share the screen and trying to understand how they use the dashboards, and how they see data, so that I would prepare dashboards actually useful for them.
Anyway thank you for help.

1 Like

So, using your basic SQL like influx query, try changing the “Format as” selector to “Table” instead of “Time Series”.

I have been able to get things with Influx to work without having to switch to Flux.

Why does this work? Uhhhhh.

2 Likes

Hi!
Wow it does indeed work. That what I meant by "hacking’ grafana. And it works quite nicely!

Thanks a lot!


http://bolge.vps.webdock.cloud:3000/d/1FHI8WnVz/tides?orgId=1&from=now-2d&to=now&var-site1=AES&var-site2=KAB&var-site3=TOS

2 Likes

Do you understand the difference between time series and table?

No. No I do not.

Should I? Will it be on the test?

It will be on the final test of the human race. Very important to know

Right. Well, I was planning on dropping out, auditing the rest of it, and then re-taking it next semester.

Frankly, I am coming to this a bit like @annawojciechowska is; I am pushing buttons at random until something works, and then moving on. (Wait, that is probably unfair to her. She is probably much more organized and smarter too.)

Frankly, the Worldmap component feels a bit un-polished. I have hoped that reporting concerns here would serve as a bug report.

But I have my own bugs to fix.

1 Like

We all learn differently and at different pace and different style.

Pressing buttons randomly is one way or you can ask people on this forum to help.

Just because you personally have a difficult time learning grafana should not be the reason you want to abandon the product.

Make the product better by making owners of the product the challenges you are facing and how to make it better.

I work with time series, and in addition I study oceanography now, lots of time series data. Grafana is for me visualisation tool, mostly for prototyping some ideas. It has some “math” to it, but very basic. I have limited time to babysit software - If “monkey pseudo randomn” pressing of buttons works, and I will have my data displayed in what I will be able to judge as correct - I will use it. If the documentation would be written in more structured way, I would use it. But I am no t willing to spend several days to dig out things from documentaitons. Most likely I would give up. use old good-bad matplotlib or implement stuff on my own. Brutal but real. We all have limited time.

Also about grafana hacking or random pressing buttons.
There is a concept of grafana variable, usually resolved to actual value by $ eg. $myVar = my value. But it is unclear in which elements of the grafana plugins it can be used - it can be in queries, labels, panel tittles, but not as a marker in worldmap plugin. I do not know any place in documentation explicitly telling what is the scope of this variable and where I can use t. So in this case the fastest way is simply playing with it. That’s also what i refer to lack of consistency. Some grafical ui text fields accept this “variables logic” some not.

2 Likes