57 Commits

Author SHA1 Message Date
Arjun Naik
888e76b748 Fix all errors from golangci-lint command
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-27 15:54:15 +02:00
Arjun
7c848a1282 Max collector should ignore only no result errors (#50)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-27 14:54:20 +02:00
Arjun
445c7c874a Added golangci linter (#51)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-27 13:35:55 +02:00
Arjun
2eed3e64d0 Return a value when atleast one of the metrics returns a value (#47)
* 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>
2019-04-26 17:54:25 +02:00
Mikkel Oscar Lyderik Larsen
f097e63401 Add build cache for CDP build (#49)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2019-04-26 16:47:00 +02:00
Mikkel Oscar Lyderik Larsen
ca4e2008c4 Merge pull request #48 from zalando-incubator/fix-config-key
Remove unused Configuration key from MetricConfig
2019-04-26 16:34:48 +02:00
Mikkel Oscar Lyderik Larsen
3f019a1ceb Remove unused Configuration key from MetricConfig
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>
2019-04-26 16:19:53 +02:00
Arjun
5a6f4997bd Add the labels from the zmon check into the config object (#46)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-04-18 13:34:11 +02:00
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
Mikkel Oscar Lyderik Larsen
d5b803d923 Merge pull request #43 from zalando-incubator/fix/panic
Fix nil dereference panics for the Annotation config parser
2019-04-04 15:00:46 +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
04b212175e Added clarification of dummy-pod (#42)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-03-25 16:15:54 +01:00
Arjun
478c97d5cb Added instructions on configuring adapter to collect ingress metrics (#34)
Signed-off-by: Arjun Naik <arjun.rn@gmail.com>
2019-02-24 21:03:55 +01: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
Mikkel Oscar Lyderik Larsen
7258cb7800 Merge pull request #31 from zalando-incubator/fix/no-backend
Fix case when backend is not set
2019-01-23 11:44:54 +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
Mikkel Oscar Lyderik Larsen
0da71f7702 Update aws-sdk-go version to be compatible with kube-aws-iam-controller (#22)
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2018-12-15 20:57:41 +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
4566d1aa03 Merge pull request #18 from zalando-incubator/rbac
Fix RBAC configuration
2018-12-08 14:34:58 +01:00
Mikkel Oscar Lyderik Larsen
e80b5fe6b0 Fix RBAC configuration
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2018-12-07 20:54:17 +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
Mikkel Oscar Lyderik Larsen
ee3cece2a6 Merge pull request #15 from zalando-incubator/skip-resource-types
Skipper metrics collection for resource types
2018-11-21 16:42:13 +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
Muaaz Saleem
217bf900a0 Adding test coverage (#13)
* Adding test coverage through coverall

Adding test coverage through coverall so we can see the current state of
test coverage

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>

* Fix go.sum for go 1.11.2

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

* Trying to make travis use go 1.11.2

Since go.mod and go.sum files don't seem to be compatible between
go1.11.1, trying to make travis use go 1.11.2

Signed-off-by: Muhammad Muaaz Saleem <muhammad.muaaz.saleem@zalando.de>
2018-11-14 11:02:53 +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
Arjun
d263e9cc49 Merge pull request #10 from zalando-incubator/rename-module
Rename module path from mikkeloscar -> zalando-incubator
2018-10-14 11:43:01 +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
Arjun
e44c3b3ada Merge pull request #9 from zalando-incubator/update-contributors
Removed contributors placeholder.
2018-10-12 11:33:19 +02:00
Arjun Naik
3f248d611a Removed contributors placeholder.
Signed-off-by: Arjun Naik <arjun.naik@zalando.de>
2018-10-12 10:00:56 +02:00
Mikkel Oscar Lyderik Larsen
845a1b14ed Merge pull request #8 from zalando-incubator/travis-badge-fix
travis-ci.org instead of travis-ci.com
2018-10-09 13:28:00 +02:00
Mikkel Oscar Lyderik Larsen
7534702d02 travis-ci.org instead of travis-ci.com
Signed-off-by: Mikkel Oscar Lyderik Larsen <mikkel.larsen@zalando.de>
2018-10-09 13:23:50 +02:00
Mikkel Oscar Lyderik Larsen
653c0073a5 Merge pull request #7 from zalando-incubator/travis-badge
Update travis badge to point to the right repo
2018-10-09 13:11:43 +02:00