In the Data Explorer there is the option of using the :default operator. This fills empty values with an indicated one, ie: :default(0).
However this only works if the specific metric has any values in the selected timeframe. If not, the current behaviour is to display a No Data message and no 0 value can be displayed.
"NO data" means there's no value tracked for the given timeframe, and it makes sense to show it this way instead of displaying 0 value, otherwise it will be misleading and you might think there's data reported during that period while that's not the case.
On the other side, the default(0) operator replaces all NULL values by 0. It is completely different because in this case there is data ingested for the given timeframe, but for whatever reason, the value attached to those events is empty.
Hey, @EnriqueOriol ,
I understand the "NO DATA" meaning.
However, there are some use-cases where a null does have a practical meaning, when translated to a zero.
A Client of ours uses a Custom Extension that finds the number of ocurrences of a given event using a SQL query.
When the extension can't find any, it doesn't inject a zero: it simply does not inject anything.
In this case, of a Custom Extension developed by the Client, a way to "mask" the null as a zero would be helpful to others who read the info on the dashboard.
As you stated, the :default(0) transformation only works if there has been data ingested for the given timeframe.
As it is optional to place, couldn't this transformation work when there is no data for the timeframe, as well?
Then, it would be a designer's choice: to show it as "no data" or as a zero.
Our only statement is that there should be a way to treat the missing data as expected behaviour: replacing it with a zero should be an option, in our honest opinion.
I agree there are some use-cases where a null does have a practical meaning, when translated to a zero, that's why we have the default operator. However, the problem in this case is that your data do not have a null. There's simply no data at all.
Going to the details, the thing is that we work with time-series, and we cannot know at which time should we add a zero unless there's an event with its associated timestamp (even if the event value is null).
Even if you are aggregating the serie into a single value (as is your case), your serie has no events at all, so there's basically nothing, that's not a null value.
I'm sorry but this is how metrics are intended to work. If this customer extension is reporting the number of occurrences of a given event, and they want to track occurrences of "zero" events, then they need to report those zeroes as well (or ingest a null event at least).
I also am getting no data, but it's a builtin metric, builtin:kubernetes.pods with a dimensional filter to include only Pending pods. This metric should return to 0 if there's no pods but it only displays data when it's not 0. This makes it difficult to use it for equations of taking the number of desired pods - ready pods - pending pods.
If there are no pending pods, I assume the data should be null, but default(0) seems not to be working. Any insights would be very helpful. 🙂 Also if it is not getting data in and therefore there are no null values, could you explain why that's the case for this metric. Seems something to always be reporting on.