NOTE: This is example code from this spike
- Kube cluster with heapster installed (should be installed by default if the cluster is version <=1.10)
- A doppler running somewhere that's reachable from inside the cluster
The example gathers the metrics for all pods running in the opi
namespace. Unfortunately the metrics that are returned are just cpu
and memory
and doppler requires also disk
, disk_quota
and memory_quota
to also be set for it to interpret the Envelope as a ContainerMetric.
To emit the envelopes the go-loggregator client is used. The client has a hardcoded value for the "serverName" for which the doppler certificates are valid. In this example the code in vendor
has been changed but a more permanent solution would be to add the "metron" alternative name to the certificates.