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

How to List Hosts that consume more then x% of CPU or Memory in Data explorer?

theharithsa
Dynatrace Champion
Dynatrace Champion

Greetings All,

I've got a question for those proficient in using Data Explorer and creating dashboards.

I aim to create a chart that only displays hosts consuming more than a specified percentage of CPU or Memory at any given moment. For instance, if Host A's CPU consumption exceeds 70% within a 24-hour period, I would want that host to be displayed on my chart. However, all other hosts that don't meet this threshold should not appear.

I've attempted to accomplish this with a specific query, but unfortunately, it resulted in all the hosts being listed. Can anyone assist me in this matter? Your help would be much appreciated.

builtin:host.cpu.usage:splitBy("dt.entity.host"):avg:auto:sort(value(avg,descending)):filter(series(auto,ge(70)))

 Above is the query that I used. 

Love more, hate less; Technology for all, together we grow.
2 REPLIES 2

Yosi_Neuman
DynaMight Guru
DynaMight Guru

Hi @theharithsa 

Its look like your query is working just fine ( see below with 45and 60)

Yosi_Neuman_2-1690016654379.png

Yosi_Neuman_3-1690016672396.png

Can you please share your results ?

Yos 

 

dynatrace certificated professional - dynatrace master partner - Matrix Soft Ware Division - Israel

theharithsa
Dynatrace Champion
Dynatrace Champion

I observed that we need to be careful in selecting the aggregation for the selector function, especially inside the series. If we use avg, it will take the average of all the chosen timeframes; hence, if we're looking for the data that is displayed in the graph, which gives the average CPU for the selected timeframe where in the given resolution period if the value is more than mentioned percentage. So the final query would be like this, 

builtin:host.cpu.usage:splitBy("dt.entity.host"):avg:sort(value(avg,descending)):filter(series(max,ge(75)))

 This will give us a chart of the average CPU usage % of the hosts in the given timeframe where on the resolution if any data point reaches more than 75%, it will list that host under this condition. 

Love more, hate less; Technology for all, together we grow.

Featured Posts