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

API Metrics Query - Can you filter by value?

crabbylou
Helper

I am pulling back average CPU for a few thousand servers for 1 week. I basically get 1 entry and 1 value per server.

Can I filter out all entries below a certain value?

builtin:host.cpu.usage:names:splitBy("dt.entity.host.name"):avg:sort(value(avg,descending)):limit(10000)

I really only want anything above 80.

My reason is because Dynatrace is cutting me off with a warning:

dynatrace-warning: Metric data is missing from the result! The query was limited to 10 000 000 data points.

Any advice is appreciated.

Lou

2 REPLIES 2

victor_balbuena
Dynatrace Mentor
Dynatrace Mentor

You're looking at using the partition transformation on the metric selector. With this transformation, you create a new dimension for a datapoint, which can be something like cpuhigh that is "yes" when the value is above 80. The rest of the datapoints will be ignored by the metric selector.

See my example where any datapoint below 80 is discarded:

victor_balbuena_0-1699036329378.png

 

Thank you Victor, I will give this a try.

Featured Posts