As I mentioned above, you already have what you want. You just need to transform your data from a time series into a 1-data-point table. The way you do this is by creating a table panel in your dashboard, and set the following:
Change Max data points to 1.
Set query type to Instant.
Add Organize fields transformation and hide the timestamp.
I don’t have your logs, but I will try to provide an example below using similar data. Hopefully it’s not confusing. You are looking for number of unique mbid for each client ip, and let’s say I am doing something similar and looking for number of unique containers in each AWS region. I have this query here:
count by (aws_region) (
sum by (aws_region, container_id) (
count_over_time({container_id=~".+"}[$__auto])
)
)
I applied the setting same as you provided, but I got below 2 different results with different interval setting. I checked the official document but still cannot find the problem.
I set 10m as interval then I got 3, and do you know why the “Alert” tab page is gone?
here is the related log record, retrieved by executing the same query in “Explore” page. the log are created in same minute (time is highlighted below)
Because you are setting the interval implicitly already via setting the number of data point to 1, you have to use $__auto in your query.
It’s better to use time series for alerting. We don’t generate alert from Grafana, we use Loki Ruler, so I am probably not going to be able to comment on this too much.