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 in MySQL and metric in InfluxDB #203

Open exit2escritical opened 5 years ago

exit2escritical commented 5 years ago

Hi there,

I guess this could be the same that erlfos was pointing... https://github.com/grafana/worldmap-panel/issues/176

The problem I'm facing is that our location coordinates are in a mysql db, I have created a query to get those coordinates + host_name.

The metrics though are in an InfluxDB...

Attached both queries:

image

After that I configure the world map to paint the geoloc using latitude and longitude from mysql query, and name those points with host_name -> This works fine

But I want a metric to be placed on each host_name (rta) -> This doesn't work

image

What am I missing?

amotl commented 5 years ago

Dear @exit2escritical,

when using the Table-Format with InfluxDB, the Worldmap Panel will try to obtain coordinates from there. As you are telling us that

The metrics though are in an InfluxDB...

You should probably use Timeseries-Format for that guy.

However, this will not necessarily lead to a working whole. I currently can't make up a map [sic!] in my mind whether it will work what you are trying to achieve. Nevertheless, we will be happy to hear about any outcome.

Good luck!

With kind regards, Andreas.

exit2escritical commented 5 years ago

Hi @amotl,

Thanks a lot for your interest in my problem.

Let me explain again my problem:

Can I paint the hosts in the worldmap using the coordinates (which are in the mysql db) and show one metric (which is in influxdb)?

exit2escritical commented 5 years ago

The hosts are painted in their correct location with the first query

image

How can I show the metric I want in each host?

I really appreciate your help, Alba.

amotl commented 5 years ago

How can I show the metric I want in each host?

When using the timeseries format, you should probably alias the metric field mean(value) as value and not rta in your query expression, which is the way it is supposed to be routed correctly.

With kind regards, Andreas.

amotl commented 5 years ago

Dear @exit2escritical,

any news?

With kind regards, Andreas.

exit2escritical commented 5 years ago

Nop, I changed the alias in the query and also in the MapDataOptions and still same result :( I guess I'm missing how to link/connect them together...

Bummer.

amotl commented 5 years ago

Bummer.

You might want to save and reload the dashboard after making these changes. The refresh/reload behavior when working in the dashboard editor is not optimal with 0.2.0.

Let us know if you are still not able to make any progress.

exit2escritical commented 5 years ago

Still the same...

My query in influxDB is as follows: SELECT mean("value") FROM "metric_rta" WHERE time >= now() - 6h GROUP BY host_name

Result: ....

name: metric_rta tags: host_name=wocu-demos time mean


1561963766052817429 0.04205613577023496

name: metric_rta tags: host_name=wocudevel time mean


1561963766052817429 1.0336494095674973

name: metric_rta tags: host_name=www.a3sec.com time mean


1561963766052817429 14.306394452777779

So I guess my metric field at worldmap it has to be named: mean

It does not work either way...

Thanks.

amotl commented 5 years ago

Dear @exit2escritical,

we have to admit we just took another look at your initial question again, this time slightly more focused. Now we see that you have been asking for a specific thing we missed beforehand.

Recap

Let me explain [...]:

  • Coordinates are stored in a MySQL database.
  • Metrics are stored in an InfluxDB database.

I guess this could be the same that @erlfos was pointing [out with #176].

image

Thoughts

This sounds familiar now. As you referenced #176 already which naturally came to mind, we would like to complete the list of similar requests here.

Probably directly related

Maybe loosely related

Outlook

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 Worldmap Panel NG just recently, 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.

I believe we recently discussed that detail as well and we further believe the revamped code base will now be able to carry some more features again and is quite ready for that.

With kind regards, Andreas.

exit2escritical commented 5 years ago

Oh! great then, I'll be tuned!

Regards,