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

Process Memory /CPU usage per host and Service

eranma
Frequent Guest

I'm trying to create a timeseries tile that presents a Process Memory /CPU usage per host, and filter it according to a variable called "ServiceId". for example :

I use a variable called "ServiceID" and i choose "Service-123". I want to receive a tile for the CPU and another one for memory usage of the Service's process, spited by the hosts it is running on.  so if it runs on server A and Server B i  will get a tile with 2 graphs showing the memory  usage of the service's process (same for CPU).

i tried to create several DQL for that but couldn't get to a correct one. i'll be glad for advise and code examples.

Thanks!

3 REPLIES 3

sia_h
Dynatrace Champion
Dynatrace Champion

Try this:

timeseries avg(dt.process.cpu.usage), by: { dt.entity.process_group_instance, dt.entity.process_group, dt.entity.host }
| fieldsAdd dt.entity.process_group_instance.name = entityName(dt.entity.process_group_instance)
| fieldsAdd dt.entity.process_group.name = entityName(dt.entity.process_group)
| fieldsAdd dt.entity.host.name = entityName(dt.entity.host)
| fieldsAdd value.A = arrayAvg(`avg(dt.process.cpu.usage)`)
| lookup [ fetch dt.entity.service
| fields entity.name, id, runs_on
| fieldsFlatten runs_on
], sourceField:dt.entity.process_group, lookupField:runs_on.dt.entity.process_group
| filter lookup.entity.name == $Service

 
Variable Service

fetch dt.entity.service
| fields entity.name

 

Dashboards-Demo-Live-guu84124-Dynatrace.png

eranma
Frequent Guest

Thanks that helps!

Any chance to get the legend as the process name and the host name? currently it's the process name and the host id

sia_h
Dynatrace Champion
Dynatrace Champion

You can update that in the Legend and tooltip section under Visual:

Dashboards-Demo-Live-guu84124-Dynatrace.png

Featured Posts