Hi!
I installed loki + promtail in docker containers, and attach loki datasource in grafana. Simpliest graphs are showing good, so Grafana receive data from loki.
Promtail analyze logs of traefik and send it to loki, this seems works.
Now I want to make a graph panel in Grafana to display most active ip addresses, which send largest number of http requests to traefik. On X axis I want to see ip address, on Y - count of requests on selected range in top left (count of all requests from this ip as a bar). Sorted from left to right descending.
I added new label ClientHost (contains ip address) in Promtail (may be it is not good solution, because set of ip addresses may have high cardinality, but it is not a problem for now).
How to make a graph, which shows bar chart of top 25 most active ip’s?
My logql query is:
topk(25, sum by (ClientHost) (count_over_time({job="traefik", ClientHost!="172.16.16.1"} [$__range])))
But seems that is a time series data, and bar chart not showing correctly.
And second question: it is possible to make this graph without adding ClientHost label and how to do it?