-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Kubernetes(Collector) #5
Conversation
Thank you for starting this. |
collector/kubernetes.go
Outdated
var wg sync.WaitGroup | ||
for _, nodepool := range cluster.NodePools { | ||
wg.Add(1) | ||
go func(np *godo.KubernetesNodePool) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really need this goroutine here, do we? It should just work without it and then we don't need the working group either.
Am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was anticipating having more work to do calculating metrics for the NodePools; I'll remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolved: 4b6ac4c
I think this is a suitable basic implementation. |
Alright. One last comment about the metric names. - digitalocean_kubernetes_cluster_count 1
+ digitalocean_kubernetes_clusters 1
digitalocean_kubernetes_cluster_up{id="f74f45ec-0c53-4e96-8f22-XXX",name="metalmatze",region="fra1",version="1.14.8-do.2"} 1
- digitalocean_kubernetes_nodepools_count{id="f74f45ec-0c53-4e96-8f22-XXX",name="metalmatze",region="fra1",version="1.14.8-do.2"} 1
+ digitalocean_kubernetes_nodepools{id="f74f45ec-0c53-4e96-8f22-XXX",name="metalmatze",region="fra1",version="1.14.8-do.2"} 1
- digitalocean_kubernetes_nodes_count{id="5879b3c5-1b25-49d3-9ff3-XXX",name="pool-0dgh51ahd",region="fra1"} 3
+ digitalocean_kubernetes_nodes{id="5879b3c5-1b25-49d3-9ff3-XXX",name="pool-0dgh51ahd",region="fra1"} 3 If you want to, you can rebase against the new current master to make use of Go modules and the activated Drone CI, otherwise, we can simply merge it too, as I verified it locally. 😊 |
I realized my mistake in computing I will remove the metric entirely. Count should be computed by summing the e.g. |
Ready when you are. Is this good to go from your side? |
Thanks a lot for this valuable contribution! 🎉 |
What do you think to my progressing this?
It provides basic (cluster, nodepool, node) counts for Digital Ocean's Kubernetes service.
By the way, this inspired a similar solution for Linode (link). My motivation is to standardize on a way to monitor and alert on resources I'm using across multiple cloud platforms (Google Cloud Platform, Digital Ocean and Linode) in order to keep my bills reasonable.
Since you created this, Go Modules are now a good package management solution for Golang.If you're supportive, I propose replacing dep with Go Modules?