Hello,
I am trying to limit the results returned in range vector. I tried using topk
to limit my return but it is returning more than n specified.
I found this on the web:
This is because it returns top
N
time series independently per each timestamp on the graph.
docs
Here is an example of a query I am trying to plot on grafana:
topk(5,
sum by (service) (traefik_service_request_duration_seconds_sum{service=~"$service.*",protocol="http"} )/
sum by (service) (traefik_service_request_duration_seconds_count{service=~"$service.*",protocol="http"})
)
How would I limit my result to just 5 services ? Is there a work around for this? I see someone recommend using topk_max in the docs, but prometheus uses promql and not sure how I can use metricsSql with it.
Grafana V 8.3.4
Thank you for your time!