Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

examples for grouping #3

Closed
biohazardxxx opened this issue Oct 20, 2017 · 4 comments
Closed

examples for grouping #3

biohazardxxx opened this issue Oct 20, 2017 · 4 comments

Comments

@biohazardxxx
Copy link

biohazardxxx commented Oct 20, 2017

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
Copy link
Owner

digrich commented Nov 1, 2017

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
Copy link
Author

biohazardxxx commented Nov 3, 2017

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
Copy link
Owner

digrich commented Nov 8, 2017

@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
Copy link
Author

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

digrich added a commit that referenced this issue Feb 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants