Skip to content

Commit

Permalink
Allow Lease metrics to be exported across all namespaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lantingchiang committed Sep 27, 2022
1 parent 12402a5 commit 8f883f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions docs/lease-metrics.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Lease Metrics

| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- | ----------- | ----------- |
| kube_lease_owner | Gauge | `lease`=&lt;lease-name&gt; <br> `owner_kind`=&lt;onwer kind&gt; <br> `owner_name`=&lt;owner name&gt; | EXPERIMENTAL |
| kube_lease_renew_time | Gauge | `lease`=&lt;lease-name&gt; | EXPERIMENTAL |
| Metric name| Metric type | Labels/tags | Status |
| ---------- | ----------- |-------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
| kube_lease_owner | Gauge | `lease`=&lt;lease-name&gt; <br> `owner_kind`=&lt;onwer kind&gt; <br> `owner_name`=&lt;owner name&gt; <br> `namespace` = &lt;namespace&gt; | EXPERIMENTAL |
| kube_lease_renew_time | Gauge | `lease`=&lt;lease-name&gt; <br> `namespace` = &lt;namespace&gt; | EXPERIMENTAL |
4 changes: 2 additions & 2 deletions internal/store/lease.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,10 +107,10 @@ func wrapLeaseFunc(f func(*coordinationv1.Lease) *metric.Family) func(interface{
func createLeaseListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher {
return &cache.ListWatch{
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
return kubeClient.CoordinationV1().Leases("kube-node-lease").List(context.TODO(), opts)
return kubeClient.CoordinationV1().Leases("").List(context.TODO(), opts)
},
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
return kubeClient.CoordinationV1().Leases("kube-node-lease").Watch(context.TODO(), opts)
return kubeClient.CoordinationV1().Leases("").Watch(context.TODO(), opts)
},
}
}

0 comments on commit 8f883f0

Please sign in to comment.