Kubernetes API exporter

396 views
Skip to first unread message

Tom Wilkie

unread,
Aug 3, 2016, 7:39:50 AM8/3/16
to prometheus-developers
Hello!

I've built a small Prometheus exporter for gauges in the Kubernetes API:


I was trying to solve the problem of getting alerts for when Deployments fail.  I couldn't find the metrics exposed natively by Kubernetes itself, but I would be interested to hear how other people have solved this problem.

Any other feedback would be very welcome!

Thanks

Tom

Tobias Schmidt

unread,
Aug 3, 2016, 4:01:43 PM8/3/16
to Tom Wilkie, prometheus-developers
Thanks! We've a similar needs and were talking about a kubernetes
exporter as well. We wish to have metrics on pod restarts for example.

So far we don't collect any such metrics with Prometheus. One idea was
to add a second monitoring endpoint to the kubelet which could export
such meta information.
> --
> You received this message because you are subscribed to the Google Groups
> "Prometheus Developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to prometheus-devel...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Tom Wilkie

unread,
Aug 3, 2016, 4:14:09 PM8/3/16
to Tobias Schmidt, prometheus-developers
Pod restarts is a fantastic example. We're going to add something for crash looping pods to. 

I'll put together something for pods tomorrow. 

Thanks

Tom

frederic...@coreos.com

unread,
Aug 4, 2016, 3:54:03 AM8/4/16
to Prometheus Developers, tob...@gmail.com
Hi there,

we're actually looking into adding some additional metrics into kubernetes itself. These are great examples! We'll try to get some of these into kubernetes directly. Thanks for collecting these metrics that are relevant in real scenarios, it really gives us a good idea of what to implement and a head start in terms of investigation ;)

Cheers
Frederic

Fabian Reinartz

unread,
Aug 4, 2016, 4:01:35 AM8/4/16
to frederic...@coreos.com, Prometheus Developers, tob...@gmail.com
For context: Frederic is our latest addition to the monitoring team at CoreOS :)

Tom Wilkie

unread,
Aug 4, 2016, 6:42:37 AM8/4/16
to Fabian Reinartz, frederic...@coreos.com, Prometheus Developers, Tobias Schmidt
we're actually looking into adding some additional metrics into kubernetes itself. These are great examples! We'll try to get some of these into kubernetes directly. Thanks for collecting these metrics that are relevant in real scenarios, it really gives us a good idea of what to implement and a head start in terms of investigation ;)

That would be awesome!  Let me know if I can help.

Thanks

Tom

Romain Vrignaud

unread,
Aug 4, 2016, 8:20:56 AM8/4/16
to Tom Wilkie, Fabian Reinartz, frederic...@coreos.com, Prometheus Developers, Tobias Schmidt
Hi guys,

We are using kube-state-metrics : https://github.com/kubernetes/kube-state-metrics for this (pod restart)

Tom Wilkie

unread,
Aug 4, 2016, 8:39:41 AM8/4/16
to Romain Vrignaud, Fabian Reinartz, frederic...@coreos.com, Prometheus Developers, Tobias Schmidt
Excellent - I wish I'd know about that before I coded up kube-api-exporter.  Will give it a try.

Thanks

Tom

Bryce Walter

unread,
Aug 5, 2016, 12:53:19 AM8/5/16
to Prometheus Developers
It would be great if Prometheus could be set up to use kubectl or kubelet with their kube-configs. This would make gathering metrics a lot easier. Especially now that Kubernetes has branched off SkyDNS/Kube2Sky in favor of kube-dns. During the transition, they seemed to have dropped the code that probes and scrapes much needed ClusterDNS
Data. I know @thawkin posted about it last week, but don't see any movement on it yet.
The new service doesn't have the /metrics endpoint.
Reply all
Reply to author
Forward
0 new messages