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

Extracting Date and Time of a Value within a Timeframe in Dynatrace DQL

PenteadoDouglas
Visitor

Hello,

Hello, everyone! I need help creating a DQL query to extract the exact date and time of a record within a timeframe. In the example from the image, I would like to apply a filter for values >= 890k (but it could be any value in the filter) and capture the corresponding timestamp. In the attached screenshot, the record would be at 04:36. Currently, I’m using the following DQL as a starting point:

timeseries count = max(dt.service.request.count, rollup: sum)

Can someone guide me on how to adjust the query to meet this requirement?

Thank you!

Douglas Penteado

 

2 REPLIES 2

krzysztof_hoja
Dynatrace Champion
Dynatrace Champion

On my environment it looks like this:

krzysztof_hoja_0-1732870452930.png

and the query to get timestamps of datapoints above certain thresholds (1800 in my example) can look like this:

timeseries count = max(dt.service.request.count, rollup: sum), timestamp=start()
| fieldsAdd d=record(count=count[], timestamp=timestamp[])
| fieldsAdd d = arrayRemoveNulls( iCollectArray( if(d[][count]>1800, d[] )))
| expand d
| fields timestamp=d[timestamp], count=d[count]

  

krzysztof_hoja_1-1732870544172.png

Iterative expressions are very useful for array processing (in this case filtering).
Also to get this task done you need to know timestamp for each datapoint. For this start() or end() special timeseries. are needed

PenteadoDouglas
Visitor

that's it, thank you

Featured Posts