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

How to get process availability using DQL

heramb_sawant
Organizer

Hi ,
I need help to built DQL to  get process  availability in % , Can somebody please help on this.

Regards,
Heramb Sawant

3 REPLIES 3

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

It requires getting all timeseries of availability state for process (in my example for process_group) and then calculating percentage of existence of availability state vs all states.

In my sample case it looks like this:

krzysztof_hoja_0-1747756931613.png

timeseries availability=sum(dt.process.availability), by:{availability.state, dt.entity.process_group}
, filter:in(dt.entity.process_group, {"PROCESS_GROUP-0517A6E81E811092"})
, interval:5m
| summarize { availability = 100*sum(if(availability.state=="available",availability[])) / sum(availability[])}, 
by: {interval, timeframe, dt.entity.process_group}

 

by executing this query you can look at the data behind:

timeseries availability=sum(dt.process.availability), by:{availability.state, dt.entity.process_group, dt.entity.process_group_instance}
, filter:in(dt.entity.process_group, {"PROCESS_GROUP-0517A6E81E811092"})
, interval:5m

krzysztof_hoja_1-1747757099116.png

there are 2 PGIs over time and at certain moment 2 of them become unavailable.

 

GerardJ
Mentor

@krzysztof_hoja  top answer! every time your answers go into my bookmarks!
Just a quick note because until recently I didn't know it was possible to use a conditional function inside an aggregation function, until I tried it and hoped it would work.
Looking at the documentation, there's no such example and there's a countif() function while there's no sumif() or anything else. So it would be nice to have more examples of how to do conditional aggregations in the documentation. I've also recently had the same thought about the iCollectArray function, which is very powerful but not well reflected in the documentation because there aren't enough examples of its use.

Gerard

I agree! Doc should contain more examples

Featured Posts