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

Adding timeframe in metric query for metric events

KVL
Visitor

I am trying to create a metric event using metric selector and the following query:

(builtin:service.requestCount.total:filter(eq("dt.entity.service","SERVICE-9BE003D3882DE5E9")):splitBy()-builtin:service.requestCount.total:filter(eq("dt.entity.service","SERVICE-6AE4AF81ED4ED89B")):splitBy())

Note that there is a possible lag between the 2 service request counts, therefor I want to sample once every 5 or 10 minutes.

However metric events sample by default once every minute and I did not find a way to change this, so I was thinking to possibly put the sample timeframe in the query, is that something that's possible to do? I wasn't able to find it in the documentation.

If not, is there any other was to change the sampling time frame from 1 minute samples?

3 REPLIES 3

Eric_Yu
Dynatrace Advisor
Dynatrace Advisor

It seems very weird that you'd have to do this, but if it really is the case, it sounds like the timeshift transformation might be useful.

https://docs.dynatrace.com/docs/shortlink/api-metrics-v2-selector#timeshift

Eric Yu

Hi @KVL,

First, I believe I know what You want to achieve (tried this many times), and it isn't best solution.

But if You want to have aggregate data from 5min You can use “:rate(5m)”. This way You will get collective data for each 5min. Still calculation error stays due first and last minutes of respective services.

Using timeshift as @Eric_Yu suggested have similar issue as some requests are within Your original minute and some are in timeshifted one. I personally consider rate being better of those 2.

Best way is using Grail and DQL where You can match Business identifier in both of those transactions and count those that doesn't have match.
With this option You will not only give You exact data, but also can be used to find those specific transaction that didn't went through process with second request.

Bests
Michał

Could you please give me an example of this? What query would I use to achieve this comparison with DQL?

"

Best way is using Grail and DQL where You can match Business identifier in both of those transactions and count those that doesn't have match.
With this option You will not only give You exact data, but also can be used to find those specific transaction that didn't went through process with second request.



."

Featured Posts