Commit Graph

85 Commits

Author SHA1 Message Date
Max Leonard Inden 50c443fd70
*: Reintroduce TYPE text 2018-11-29 15:43:58 +01:00
Max Leonard Inden ce5c90fbf1
pkg/collectors: Refactor hpa collector 2018-11-29 15:43:57 +01:00
Max Leonard Inden 3778527880
pkg/collectors: Refactor endpoint collector 2018-11-29 15:43:55 +01:00
Max Leonard Inden 13c990201f
pkg/collectors: Refactor resource quota collector 2018-11-29 15:43:55 +01:00
Max Leonard Inden 56b4211eb1
pkg/collectors: Refactor replication controller collector 2018-11-29 15:43:54 +01:00
Max Leonard Inden 432cf70913
pkg/collectors: Refactor stateful set collector 2018-11-29 15:43:53 +01:00
Max Leonard Inden 94e962135c
pkg/collectors: Refactor secret collector 2018-11-29 15:43:52 +01:00
Max Leonard Inden 6556d1e196
pkg/collectors: Refactor replica set collector 2018-11-29 15:43:52 +01:00
Max Leonard Inden 9749758c5a
pkg/collectors: Refactor pod disruption budget collector 2018-11-29 15:43:51 +01:00
Max Leonard Inden aa688cd706
pkg/collectors: Refactor persistent volume collector 2018-11-29 15:43:50 +01:00
Max Leonard Inden 58416fdd11
pkg/collectors: Refactor persistent volume claim collector 2018-11-29 15:43:50 +01:00
Max Leonard Inden 7a4887ab9a
pkg/collectors: Refactor node collector 2018-11-29 15:43:49 +01:00
Max Leonard Inden 2220e6dbe4
pkg/collectors: Refactor namespace collector 2018-11-29 15:43:49 +01:00
Max Leonard Inden 8b70f74951
pkg/collectors: Refactor cron job collector 2018-11-29 15:43:48 +01:00
Max Leonard Inden 696deb01f5
pkg/collectors: Refactor configmap collector 2018-11-29 15:43:48 +01:00
Max Leonard Inden ddb54cacd7
pkg/collectors: Refactor limit range collector 2018-11-29 15:43:47 +01:00
Max Leonard Inden e44b956eeb
pkg/collectors: Refactor job collector 2018-11-29 15:43:46 +01:00
Max Leonard Inden f39dde246c
pkg/collectors: Refactor deployment collector 2018-11-29 15:43:45 +01:00
Max Leonard Inden 7b3651f39b
pkg/collectors: Refactor DaemonSet collector 2018-11-29 15:43:45 +01:00
Max Leonard Inden 7ac0ab7410
pkg/builder: Make collector order deterministic
Instead of iterating a map of enabled collectors, iterate a sorted
slice to achieve determinism across scrapes.

Having a consistent order in the metrics output enables Proemetheus to
apply optimizations during metric parsing and ingestion.
2018-11-29 15:43:44 +01:00
Max Leonard Inden 53a10b38cf
main_test.go: Extend pod fixture and fix bench set bytes 2018-11-29 15:43:44 +01:00
Max Leonard Inden af714c7a66
pkg/whiteblacklist: Encapsulate white- blacklisting logic into pkg 2018-11-29 15:43:42 +01:00
Max Leonard Inden ae0644323b
pkg/collectors: Refactor Pod collector 2018-11-29 15:43:42 +01:00
Max Leonard Inden 665e922477
*: Adjust tests
- Split main benchmark test

- Add main smoke test
2018-11-29 15:43:41 +01:00
Max Leonard Inden 581c49d593
pkg/collectors: Reintroduce help text 2018-11-29 15:43:39 +01:00
Max Leonard Inden d44a8bc991
pkg/collectors: Renable white-/blacklisting
Reenable feature to filter the exposition of metric families by their
name. This is now done at startup time, thereby not slowing down the
critical path.
2018-11-29 15:43:36 +01:00
Max Leonard Inden 4cc7e9be49
pkg/options: Add flag to enable gzip encoding for responses
Dependent on the environment users might or might not want to encode the
responses of kube-state-metrics via gzip independent of the
`Accept-Header` that the client (Prometheus) sends.
2018-10-24 16:11:53 +02:00
Max Leonard Inden 234d788a0d
*: Optimize performance & resource utilization via custom metrics store
This patch introduces a custom client go store, MetricsStore. It is
updated by a corresponding reflector. Instead of generating the
Prometheus custom metrics on demand, metrics are generated on new
Kubernetes object arrival.

In addition this patch replaces most of the logic of the Prometheus
client_golang package by its optimized custom logic to render metrics in
text format.

Next to these main changes this patch also includes:

- Documentation/design: Add performance optimization proposal
- tests/e2e.sh: Ignore "no help text" warnings by promtool
- .travis.yml: Run tests in parallel
  As non of the Travis tests depend on each other, there is no reason to
  run them in sequence. Instead this patch makes them run in parallel.
2018-10-16 15:49:16 +02:00
Lv Jiawei a1fe672a4d
Update main_test.go 2018-09-13 15:51:19 +08:00
lvjiawei c123bb5933 Change error message
The test creates two resources(pod, configmap), not only pod added.
2018-09-13 15:36:07 +08:00
Max Leonard Inden 183c7988fb
main_test.go: Introduce overarching benchmark test
This patch adds a simple go benchmark test, injecting Kubernetes objects
and simulating scrape requests. It uses the Kubernetes client-go fake
client. Alongside comes some refactoring of each collectors structure
using informer factories to be compatible with the fake client.

The patch lays the groundwork to make future performance optimizations
comparable with past versions.

How to run test:
`go test -race -bench  . -memprofile=mem.out -cpuprofile=cpu.out`
2018-08-17 11:52:02 +02:00
Fabian Reinartz 53ddc0e346 Rework node metrics
This commit reworks node metrics in the same manner as deployment
metrics.
The node states are broken out into one time series for each possible
conditional state. One constant metric holds textual meta information
about cluster nodes.
2016-09-07 10:31:28 +02:00
Frederic Branczyk ed505ccd41 Container restart metric (#9)
* Rework container restart metric

This commit reworks the container restart metric in the same manner as
deployment metrics. The format remains unchanged to the previous format
as in one metric per container via labels.

* Normalize expected string representation

To be able to compare strings easier when a failure occurs, remove empty
lines and trim whitespace for each line of the expected metrics string.
2016-09-07 10:20:31 +02:00
Fabian Reinartz b15680d96d Rework deployment metrics (#6)
* Update prometheus client vendoring

* Rework deployment metrics

This change extracts the deployment metrics into their own
deployment collector. The metrics are collected synchronously with
each scrape rather than every 10 seconds.

The `deployment` label replaces the `name` label to avoid name
collisions further up in the monitoring chain.
2016-09-01 15:58:22 -07:00
Sam Ghods 795d6c51e7 Create kube-state-metrics 2016-05-06 14:36:03 -07:00