This is a slight refactoring/unification of how metric
labels/annotations are parsed and handled accross collectors. This is
done to prevent crashes when labels are not defined on external metrics.
Fix#69
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
* Prevent leaking collectors when HPA gets updated
This fixes an issue where collectors would be leaking when HPAs are
getting updated.
Fix this by stopping the collector started for the previous version of
the HPA.
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
* Add tests to verify old collector is removed
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
* Return a value when atleast one of the metrics returns a value
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
* Added test for max weighted collector
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
This fixes an issue of setting up a ZMON collector where the incorrect
key `Configuration` was used, which was not initialized in the metrics
config parser. The `Config` key is the right one to use.
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
* Added weighting of rps metrics based on backend weights
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
* Updated documented with instructions on how to use the backend weighting
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
* Changed separator for RPS metric and added flag to specify backend weights annotation.
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
* Allow for multiple backends with for weighting.
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
* Look at total replicas instead of readyReplicas
In cases where replicas take a bit of time to get ready, the Stackset Controller just keeps on scaling. To avoid this issue,
using the total replicas instead of replicas that are ready.
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
* Fix bitbucket clones
Signed-off-by: Alexey Ermakov <alexey.ermakov@zalando.de>
* Updating .gitignore
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
* Fixing Typo
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
* Adding tests to avoid regression
Testing that collectors depend on Resource.Status.Replicas and not
Resource.Status.ReadyReplicas
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
Adding tests for error cases in metric_store.go. This will primarily
protect against regression.
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>