|
1 | | -# kube-events-exporter |
| 1 | +# kube-events-exporter |
| 2 | +[](https://travis-ci.org/rhobs/kube-events-exporter) |
| 3 | +[](https://opensource.org/licenses/Apache-2.0) |
| 4 | + |
| 5 | +**⚠️** This project is still under development and has not been proven stable yet. |
| 6 | + |
| 7 | +## Overview |
| 8 | + |
| 9 | +Kubernetes Events provide an insight into the cluster, we want to leverage that |
| 10 | +by aggregating and exposing metrics about these events. It will be left to the |
| 11 | +user to choose which Events should be aggregated and exposed by the exporter. |
| 12 | + |
| 13 | +## Design |
| 14 | + |
| 15 | +Please refer to the [design document](./docs/design-document.md). |
| 16 | + |
| 17 | +## Metrics |
| 18 | + |
| 19 | +The exporter exposes metrics over two different HTTP servers. One exposing |
| 20 | +metrics about Kubernetes Events and another one metrics about the exporter |
| 21 | +health. |
| 22 | + |
| 23 | +Note that the listening addresses of the servers can be configured via flags.. |
| 24 | + |
| 25 | +From the information gathered on the Events, the expoter expose the following |
| 26 | +metric: |
| 27 | + |
| 28 | +``` |
| 29 | +kube_events_total{type=””, involved_object_namespace=””, involved_object_kind=””, reason=””} |
| 30 | +``` |
| 31 | + |
| 32 | +This metric represent the number of Event that were emitted since the exporter |
| 33 | +started running in the cluster. |
| 34 | + |
| 35 | +Part of this metric, it is possible to get information about the Event type |
| 36 | +(Normal, Warning, ...), its reason and the object involved. |
| 37 | + |
| 38 | +## Cardinality |
| 39 | + |
| 40 | +The cardinality of the metrics exposed by the default configuration of the |
| 41 | +exporter is reasonable. After running it for two months in an OpenShift cluster |
| 42 | +with around 60 namespaces, the exporter only generated around 500 series. |
| 43 | + |
| 44 | +However, the cardinality tends to grow exponentially along with the size of the |
| 45 | +cluster. Thus, we added mechanisms to reduce the amount of series generated and |
| 46 | +make sure that all the labels are bounded. |
| 47 | + |
| 48 | +The exporter has flags filtering some Events to reduce the number of generated |
| 49 | +series. |
| 50 | + |
| 51 | + |
| 52 | +- --event-types : List of allowed Event types. Defaults to all types. |
| 53 | +- --involved-object-api-groups : List of allowed Event involved object API groups. Defaults to all API groups. |
| 54 | +- --involved-object-namespaces : List of allowed Event involved object namespaces. Defaults to all namespaces. |
| 55 | +- --reporting-controllers : List of controllers allowed to report Event. Defaults to all controllers. |
| 56 | + |
| 57 | +For example, if we want to only expose metrics about Warning Events involving |
| 58 | +v1 API group objects reported by the kubelet in the default namespace. We |
| 59 | +would have the following flags set: |
| 60 | +``` |
| 61 | +--event-types=Warning |
| 62 | +--involved-object-api-groups=v1 |
| 63 | +--involved-object-namespaces=default |
| 64 | +--reporting-controllers=kubelet |
| 65 | +``` |
| 66 | + |
| 67 | +## Prerequisites |
| 68 | + |
| 69 | +The exporter supports Kubernetes clusters starting from v1.17.0+. |
| 70 | + |
| 71 | +> Note: the exporter might work in previous versions but there is no guarantee. |
| 72 | +
|
| 73 | +## Quickstart |
| 74 | + |
| 75 | +To try the exporter in a Kubernetes cluster, you can run the following command: |
| 76 | + |
| 77 | +```sh |
| 78 | +kubectl create -f manifests/ |
| 79 | +``` |
| 80 | + |
| 81 | +This will create the most basic configuration for the exporter to run in the |
| 82 | +cluster and expose metrics to Prometheus. |
| 83 | + |
| 84 | +## Roadmap |
| 85 | + |
| 86 | +* Expose more labels |
| 87 | +* Expose metrics over HTTPS |
| 88 | +* Provide alerting/recording rules |
0 commit comments