cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dashboard tile with number of hosts with CPU bigger than 80%?

AntonioSousa
DynaMight Guru
DynaMight Guru

In Data Explorer, if you want to have a list of hosts that have, eg. more than 80% of CPU for a certain timeframe, you put the following metric selector and select table:

builtin:host.cpu.usage:splitBy("dt.entity.host"):filter(series(avg,gt(80)))

Now imagine there are 10 hosts in the list and you want a single value in a dashboard with 10 in it. Been struggling to get this use-case done 🤣 Any ideas?
And yes, it's for a Managed environment...

Antonio Sousa
12 REPLIES 12

p_devulapalli
Champion

Hi @AntonioSousa , how about using the table and pin it to dashboard ?

p_devulapalli_0-1729739424192.png

 

Phani Devulapalli

In fact table in data explorer is only way to really count records, but unfortunately, when pinned to dashboard that count is not displayed.

Alanata a.s.

rastislav_danis
DynaMight Pro
DynaMight Pro

I'm afraid it's not possible, i was trying hard with similar task.

Alanata a.s.

Julius_Loman
DynaMight Legend
DynaMight Legend

@AntonioSousa what about this?

builtin:host.cpu.usage:splitBy("dt.entity.host"):filter(series(avg,gt(10))):count:splitby():last

Julius_Loman_0-1729754607347.png

 

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

It's not working - f.e. 5 hosts with cpu>0

rastislav_danis_0-1729756165473.png

 

Alanata a.s.

@Julius_Loman 

I tried your selector and it was very volatile. It would sometimes work, but others not.

But I have worked with it, and came to this one, only without the last:

builtin:host.cpu.usage:splitBy("dt.entity.host"):filter(series(avg,gt(80))):count:splitby()

This one seems to work perfectly!

Thanks for the double splitBy() idea!

Antonio Sousa

If you skip the first splitBy() transformation, the expression can be simplified a bit and it still works.

The only requirement is that you apply the second splitBy() (in my case, the only one) before you apply the :count transformation, otherwise it won't work.

As a result, I got this:

builtin:host.cpu.usage:filter(series(avg,gt(80))):splitBy():count

 

Hope this helps!

Best regards, Pedro Deodato

rastislav_danis
DynaMight Pro
DynaMight Pro

I found out that you have to timeshift and then it's finally working:

builtin:host.cpu.usage:splitBy("dt.entity.host"):filter(series(avg,gt(0))):count:splitby():timeshift(-1m)

rastislav_danis_0-1729757162423.png

 

Alanata a.s.

it's b/c data from all records are not collected in last time bucket, for other metrics collected with >1m interval you will need to perform bigger timeshift. Here is examle of what you can get if doing last():

rastislav_danis_1-1729757382321.png

 

Alanata a.s.

simple skipping :last() without timeshift() will also work for single value, but you need to let "Auto" or "Maximum" Fold transformation with global timeframe >1m:

rastislav_danis_0-1729757843369.png

 

Alanata a.s.

AntonioSousa
DynaMight Guru
DynaMight Guru

Thanks all for your input! Several ways to do something that I believe is a good use-case 🤗
Which leaves me thinking that the efficiency of doing certain approaches in Data Explorer might lead to different usage of resources inside the Dynatrace platform.
Looks like @PedroDeodato metric selector is the most efficient, but does anyone have any idea which metric selectors are more efficient or not?

Antonio Sousa

It was very useful for me as well, thanks for posting question! @PedroDeodato 's selector is ok, but you have to also check Fold transformation (for Single value visualization) to be in correct mode (Auto or Maximum).

Alanata a.s.

Featured Posts