Hi @PedroDeodato , the problem is that, if we don’t have any data for the given timeframe, displaying a zero instead of a “No data” message might be misleading because there’s no guarantee that your query is really valid.
I mean, taking @arora138 example (built-in metric with some filter that returns no data for the whole selected period). In that case we are basically getting no results from our database. We can display an array of zeros and it would be meaningful for you, for sure, but… imagine the same query with a typo in the filter. In that case, we will get as well, no results from the database, but I don’t think an array of zeroes would make any sense in this specific scenario. On the contrary, you would probably want to know that something is wrong.
As a workaround for your concrete scenario @arora138, you can always use a calculated metric to make sure you are displaying zeroes, as long as the aggregated metric is always ingesting data from at least one host. However, you will be in the situation explained before, if there’s a typo in the filter value you write, we will not know.
I mean, you can do
( (built-in:metric * 0) + built-in:metric:filtered:auto:default(0) ).
The :auto:default(0) here provides you with zeroes matching the first metric, so the calculation can be executed.
G.e.
(builtin:kubernetes.pods:splitBy()*0 + builtin:kubernetes.pods:filter(and(or(eq(“k8s.cluster.name”,your-filter)))):auto:default(0)):sort(value(auto,descending)):limit(10)