digrich / bubblechart-panel

Bubble chart panel for grafana monitoring system.
Apache License 2.0
8 stars 9 forks source link

examples for grouping #3

Closed biohazardxxx closed 6 years ago

biohazardxxx commented 7 years ago

Hi, I am maybe to dumb, but I don't understand your descrition how grouping works. Since I am on MySQL DB. I have to write SQL. The bubble shows fine in one group so far. Can you provide an example please?

Best regards

digrich commented 6 years ago

I havn't tested with MySQL DB but in general, group hierarchy works against metric tags.

For e.g. You want to display the CPU utilization of all machines across multiple data-centers and want to group them first by datacenter and then by applications, define the tags hierarchy in alias as

$tag_datacenter,$tag_app,$tag_host

assuming you have dataceneter, app and host as tags under metric data.

biohazardxxx commented 6 years ago

Thaks for your reply. I am not sure what you mean with "...as tags under metric data." Can you maybe explain? This is how the Metric tab looks with MySQL. image

digrich commented 6 years ago

@biohazardxxx - Use CONCAT for the metric field in SQL expression to achieve multiple group hierarchy.

SELECT UNIX_TIMESTAMP(date) as time_sec, amt as value, CONCAT(server, ',', org) as metric FROM trade WHERE $__timeFilter(date) ORDER BY date ASC

biohazardxxx commented 6 years ago

Great that works superb. maybe this can be added to the readme of this repo?