'Sum counters vector by instance but distinguish per custom label
Consider we have a counters vector with custom label (version). We want to aggregate those by instances, but differentiate by that label to get % approximation in pie chart of versions in live usage. The counters grow by periodic reports from the client app which could report to any of the instances.
# instance 1
app_ver{version="1001"} 5
app_ver{version="1002"} 1
#instance 2
app_ver{version="1001"} 4
app_ver{version="1002"} 2
The following seems to be ok:
sum by (version) (app_ver)
But I can't figure out how to make that work with increase or something similar to get move live approximation for a time range, ie level out users version upgrades and times of inactivities, when there are no reports.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
