I have a simple Prometheus query where I would like to combine all last returned values into one total.
windows_iis_worker_requests_total{instance="hostname", app="IIS-Worker-Name"}
This currently returns values from all of the various IIS app pools split apart by process ID/PID. These PID’s can change of course so I’m unable to do something like a binary/math transformation to add them together.
Sample:
{_name_=“windows_iis_worker_requests_total”, app=“IIS-Worker-Name”, instance=“hostname”, job=“windows_exporter”, pid=“1000”} = 5
{_name_=“windows_iis_worker_requests_total”, app=“IIS-Worker-Name”, instance=“hostname”, job=“windows_exporter”, pid=“2000”} = 10
{_name_=“windows_iis_worker_requests_total”, app=“IIS-Worker-Name”, instance=“hostname”, job=“windows_exporter”, pid=“3000”} = 15
My goal would be to get a query that returns “30” here but every Grafana transformation I try or Prom query change like “sum” or ”group on” just seems to calculate all of the values returned instead of taking the last value from each PID and adding them up. Am I missing something really simple?