digrich/bubblechart-panel

examples for grouping

biohazardxxx opened this issue · 4 comments

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

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.

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

@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

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