Skip to content

Commit 8f883f0

Browse files
committed
Allow Lease metrics to be exported across all namespaces
1 parent 12402a5 commit 8f883f0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/lease-metrics.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lease Metrics
22

3-
| Metric name| Metric type | Labels/tags | Status |
4-
| ---------- | ----------- | ----------- | ----------- |
5-
| kube_lease_owner | Gauge | `lease`=&lt;lease-name&gt; <br> `owner_kind`=&lt;onwer kind&gt; <br> `owner_name`=&lt;owner name&gt; | EXPERIMENTAL |
6-
| kube_lease_renew_time | Gauge | `lease`=&lt;lease-name&gt; | EXPERIMENTAL |
3+
| Metric name| Metric type | Labels/tags | Status |
4+
| ---------- | ----------- |-------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
5+
| 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 |
6+
| kube_lease_renew_time | Gauge | `lease`=&lt;lease-name&gt; <br> `namespace` = &lt;namespace&gt; | EXPERIMENTAL |

internal/store/lease.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ func wrapLeaseFunc(f func(*coordinationv1.Lease) *metric.Family) func(interface{
107107
func createLeaseListWatch(kubeClient clientset.Interface, _ string, _ string) cache.ListerWatcher {
108108
return &cache.ListWatch{
109109
ListFunc: func(opts metav1.ListOptions) (runtime.Object, error) {
110-
return kubeClient.CoordinationV1().Leases("kube-node-lease").List(context.TODO(), opts)
110+
return kubeClient.CoordinationV1().Leases("").List(context.TODO(), opts)
111111
},
112112
WatchFunc: func(opts metav1.ListOptions) (watch.Interface, error) {
113-
return kubeClient.CoordinationV1().Leases("kube-node-lease").Watch(context.TODO(), opts)
113+
return kubeClient.CoordinationV1().Leases("").Watch(context.TODO(), opts)
114114
},
115115
}
116116
}

0 commit comments

Comments
 (0)