23 Oct 2024 04:57 PM
Hi,
I'd like to graph a metric that counts distinct values of a dimension over time, regardless of the time interval value.
Example :
Do you have a tip?
Solved! Go to Solution.
24 Oct 2024 09:47 PM
Here is example query which calculates distinct count of values of "k8s.workload.name" dimension over time:
timeseries {containersCnt = sum(dt.kubernetes.containers), timestamp=start()},
by: { k8s.workload.name }
| fieldsAdd d=record(containersCnt=containersCnt[], timestamp=timestamp[])
| expand d
| filterOut isNull(d[containersCnt])
| makeTimeseries countDistinct(k8s.workload.name), time:d[timestamp]
25 Oct 2024 10:32 AM
Perfect! Thanks a lot.
Are you planning to simplify makeTimeseries use for timeseries? It is not easy right now ...