178 Commits

Author SHA1 Message Date
Arjun
8db22f38a3
Fixed metric labels so that metric are tagged correct. Also added nil check (#44)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-05 16:05:37 +02:00
Arjun Naik
14f13495af Fix nil dereference panics
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-04 10:57:08 +02:00
Arjun
dfeae82cae Upgrade all pacakges to autoscalingv2beta2 (#39)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-03 10:23:52 +02:00
Arjun
f4efa2898b
Handle condition when backend weights only sometimes present (#33)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-02-01 10:59:42 +01:00
Arjun Naik
56dd8b52e0 Fix case when backend is not set
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-01-23 11:36:09 +01:00
Arjun
248acf0311
Added logic and test case for weight of backend is 0 (#29)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-01-18 17:39:01 +01:00
Arjun
75633d3082
Changed request-per-second metric separator to a comma (#28)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-01-17 13:46:57 +01:00
Arjun
72aa672f51
Added weighting of RPS metrics based on backend weights (#27)
* 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>
2019-01-17 13:13:52 +01:00
Çağdaş Şenol
f49f7821dc Fix json serialization naming for zmon queries (#25)
Signed-off-by: Cagdas Senol <cagdas.senol@zalando.de>
2019-01-08 16:24:46 +01:00
Muaaz Saleem
67ac2092f5
Look at total replicas instead of readyReplicas (#21)
* 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>
2018-12-11 14:39:34 +01:00
Mikkel Oscar Lyderik Larsen
6b8468d2ec
Merge pull request #14 from zalando-incubator/unit-tests
Adding Unit tests to metric_store.go
2018-11-22 16:57:42 +01:00
Muhammad Muaaz Saleem
e3ee745777 Testing multiple metrics inserts with different Group/Resources/Namesapces
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-22 16:36:51 +01:00
Muhammad Muaaz Saleem
28b3b3b2b7 Testing inserting multiple external metric values
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-21 18:04:55 +01:00
Muhammad Muaaz Saleem
be9b85c3cc Test errors in metric_store.go
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>
2018-11-21 17:28:00 +01:00
Arjun Naik
8492832baa Skipper metrics collection for resource types
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2018-11-21 15:16:26 +01:00
Muhammad Muaaz Saleem
d50771094a Making metrics TTL configurable per instance of metric store
Avoiding the global var and making metrics TTL configurable per
metric store

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-20 16:34:17 +01:00
Muhammad Muaaz Saleem
553f8b5993 Testing that metrics with TTL > now are not removed
This test mostly serves as protection against regression

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-20 11:00:13 +01:00
Muhammad Muaaz Saleem
b1745c5eed Making TTL configurable, at least globally
Making metrics expiration TTL configurable globally configurable.
This is so RemoveExpired can be tested. Not making the TTL configurable
per metric yet because it could change behaviour in production.

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-20 10:34:44 +01:00
Muhammad Muaaz Saleem
49cdca4c68 Testing expired metrics' removal
Testing that metrics get removed once expired. Tests are failing
because metric.TTL isn't configurable at the moment

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-19 23:28:06 +01:00
Muhammad Muaaz Saleem
7c8c239d18 Testing External Metrics Storage
Added a testcase for insert/list/get an external metric

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-19 15:57:51 +01:00
Muhammad Muaaz Saleem
fb1a08195d Testing GetMetricsBySelector
Adding test cases to get metrics by label selector

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-19 14:55:35 +01:00
Muhammad Muaaz Saleem
669eb2b441 Making the tests table driven
Adding test cases to insert/list/get a namespaced and a non-namespaced
resource metric

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-19 14:10:21 +01:00
Muhammad Muaaz Saleem
7e247ce0d4 Adding a basic test for the metricStore
Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-15 18:05:52 +01:00
Mikkel Oscar Lyderik Larsen
c86a82ca88 Simple ZMON collector implementation (#2)
* Simple ZMON collector implementation

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Add tests for ZMON client

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Add tests for zmon collector

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Update ZMON collector docs

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Expose tags instead of entities for queries

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>

* Remove unused function

Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2018-10-29 14:26:25 +01:00
Nick Jüttner
b18acf3ed0 Adding event recorder and replace glog (#12)
Signed-off-by: Nick Jüttner <nick@zalando.de>
2018-10-24 17:27:30 +02:00
Martin Linkhorst
3e7b8ba964 Expose basic go metrics via prometheus (#11)
* feat: expose basic go metrics via prometheus

Signed-off-by: Martin Linkhorst <martin.linkhorst@zalando.de>

* feat: expose basic counter of successful and failed collections and updates

Signed-off-by: Martin Linkhorst <martin.linkhorst@zalando.de>
2018-10-19 13:40:31 +02:00
Mikkel Oscar Lyderik Larsen
1daacb0873
Rename module path from mikkeloscar -> zalando-incubator
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2018-10-14 11:37:58 +02:00
Per Ploug
3db0cc3135 Adding boilerplate files
Signed-off-by: Per Ploug <per.ploug@zalando.de>
2018-10-08 13:17:05 +02:00