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

custom and dynamic timeframe data explorer

Sonia_A
Participant

 

Hello,

I want to configure a tile with data explorer and set a comparison metric between 1 week ago and the week preceding it dynamically (without setting a custom timeframe manually).

I found that i could insert a timeshift in the advanced mode of data explorer, but if i set 1w or 2w, it takes all the values from now to 1 or 2 weeks a go. And what i want to produce is an interval from 2w ago to 1w ago, and then from 1 week ago to now to have a comparison between the two following weeks.

Is it possible with something like timeshift(2w to 1w)  or is there no way to do it ?

Thanks,

1 REPLY 1

Maheedhar_T
Advisor

Hi @Sonia_A ,
This can be done with DQL. You can convert your query to DQL using notebooks. Please refer to this article.
Re: Easily convert Data explorer queries to dql for Dashboards, Notebooks and other apps - Dynatrace...

Then for the timeframe conversion you can use something like this in your DQL which gives you data for the timeframe you requested.

timeseries sum(dt.cloud.aws.alb.errors.alb.http4xx), by:{dt.source_entity.type, dt.source_entity, dt.entity.aws_application_load_balancer, aws.resource.name, aws.region, aws.credentials, aws.account.id, metric.key, dt.system.bucket},interval:1h, from: bin(now()-14d, 1d) , to: bin(now()-7d, 1d)
| fieldsAdd dt.entity.aws_application_load_balancer.name = entityName(dt.entity.aws_application_load_balancer)
| limit 20

Here the part interval:1h, from: bin(now()-14d, 1d) , to: bin(now()-7d, 1d) is the timeframe selector which gives you data of last week. We wrap the time interval in "bin" to round it off to the start of the day.

Hope this helps.
Regards,
@Maheedhar_T 

Maheedhar

Featured Posts