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?
This should return the number of requests that are faster than 300ms?
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.
Solved! Go to Solution.
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:
You need will need:
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.