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

Dater Explorer Code Query - filter synthax

r_weber
DynaMight Pro
DynaMight Pro

I'm trying to "code" a metric query that would only return data points that have a certain response time and count them. If I understand the filter syntax correct then the "series" condition in the :filter transformation should allow me to do that, right?

 

Example:
This should return the number of requests that are faster than 300ms?

builtin:service."keyRequest".response.server:filter(series(avg,lt,300000)):splitBy():count

 

But this gives an error:

Illegal transform operator: Usage of :filter(value(...)) requires a previous value extraction.

 

What exactly is meant by this error, what value extraction?

Does anyone have an example? I'd like to use this for an SLO definition.

Certified Dynatrace Master, Dynatrace Partner - 360Performance.net
1 REPLY 1

Julius_Loman
DynaMight Guru
DynaMight Guru

Hello @r_weber ,

first I don't think you can count individual requests in metric selectors at all. These metrics selectors work on timeseries data only. For counting the individual requests, you need to use the calculated service metrics and then use the metric for SLO for example. I'd also love to have the capability to count number requests with response time condition in the SLO or custom chart without using calculated service metrics, but I don't think this will come anytime soon as it is a different source of information.  So filter transformation works on dimensions. So if a metric has multiple dimensions, you can filter on any of them. 

Back to your question, you need to specify an aggregation first. So instead of:

 

builtin:service."keyRequest".response.server:filter(series(avg,lt,300000)):splitBy():count

 

You need will need:

 

builtin:service."keyRequest".response.server:count:splitBy():filter(series(avg,lt,300000))

 


This will give you the number of key requests for which the average response time in the interval is less than 300000 microseconds. I'm not sure if this is the output you want.

I believe you need the number of key requests which are faster than 300000 which is not possible without using calculated metrics.

TEMPEST a.s., Slovakia, Dynatrace Master Partner