PromQL sum by label over time
I am trying to sum up a counter metric over time and grouped by the label applied. I've tried this
sum by (searchTerm) (bot_guides_failed_total)
but I want to have out in a table form like this:
searchTerm1 : 5
searchTerm2: 1 etc..
I'm new to PromQL so let me know if you need more information form me to help me figure this out.
You need to use a function to extract the number of searches in a specific time window. E.g:
sum by (increase(searchTerm[5m])) (bot_guides_failed_total)
This will give you the number of
bot_guides_failed_totalin a 5 minutes time window.