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.
@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?