You should probably use sum by and not count by (for example, topk(1, sum by(status) (count_over_time({job="application"} | json | method != "" [$__auto]))) )
In Options (directly below where you enter the query), you’ll want to make sure you set query type to instant
In your query option you’ll want to make sure the maximum number of data point is 1.
Lastly, in your query you might want to change $__auto to $__interval.
I suspect you are seeing multiple items because you are still displaying a time series data frame, rather than all data aggregated. Try the above and see if it works for you.
If you do count by you’d be counting the number of metrics of the nested query. Let’s say your count_over_time() query returns the following results on a given time frame:
timestamp | application | < other label > | values (this is the result of count_over_time)
| app1 | <…> | 1
| app1 | <…> | 1
| app2 | <…> | 2
| app2 | <…> | 2
| app3 | <…> | 3
A count by (application) of above will return app1 = 2, app2 = 2, app3 = 1. A sum by (appplication) of above will return app1 = 2, app2 = 4, app3 = 3.