Skip to content

Commit a2adb0a

Browse files
aLekSermarkmandel
authored andcommitted
Fix stackdriver distribution without bucket bounds
New k8s metrics results in error in Stackdriver exporter. In order to fix it we need to define two infinite buckets with a delimiter of 0. Fix was verified in Stackdriver dashboard.
1 parent dd75eb8 commit a2adb0a

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎pkg/metrics/kubernetes_client.go‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ func init() {
8686
Name: "k8s_client_cache_list_items",
8787
Measure: cacheListItemCountStats,
8888
Description: "Count of items in a list from the Kubernetes API.",
89-
Aggregation: view.Distribution(),
89+
Aggregation: view.Distribution(0),
9090
}))
9191

9292
runtime.Must(view.Register(&view.View{
@@ -107,14 +107,14 @@ func init() {
107107
Name: "k8s_client_cache_watch_duration_seconds",
108108
Measure: cacheWatchesLatencyStats,
109109
Description: "Duration of watches on the Kubernetes API.",
110-
Aggregation: view.Distribution(),
110+
Aggregation: view.Distribution(0),
111111
}))
112112

113113
runtime.Must(view.Register(&view.View{
114114
Name: "k8s_client_cache_watch_events",
115115
Measure: cacheItemsInWatchesCountStats,
116116
Description: "Number of items in watches on the Kubernetes API.",
117-
Aggregation: view.Distribution(),
117+
Aggregation: view.Distribution(0),
118118
}))
119119

120120
runtime.Must(view.Register(&view.View{
@@ -144,15 +144,15 @@ func init() {
144144
Name: "k8s_client_workqueue_latency_seconds",
145145
Measure: workQueueLatencyStats,
146146
Description: "How long an item stays in the work queue.",
147-
Aggregation: view.Distribution(),
147+
Aggregation: view.Distribution(0),
148148
TagKeys: []tag.Key{keyQueueName},
149149
}))
150150

151151
runtime.Must(view.Register(&view.View{
152152
Name: "k8s_client_workqueue_work_duration_seconds",
153153
Measure: workQueueWorkDurationStats,
154154
Description: "How long processing an item from the work queue takes.",
155-
Aggregation: view.Distribution(),
155+
Aggregation: view.Distribution(0),
156156
TagKeys: []tag.Key{keyQueueName},
157157
}))
158158

‎site/content/en/docs/Guides/access-api.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: >
1212
Installing Agones creates several [Custom Resource Definitions (CRD)](https://kubernetes.io/docs/concepts/api-extension/custom-resources),
1313
which can be accessed and manipulated through the Kubernetes API.
1414

15-
Kubernetes has multiple [client libraries](https://kubernetes.io/docs/reference/client-libraries/), however,
15+
Kubernetes has multiple [client libraries](https://kubernetes.io/docs/reference/using-api/client-libraries/), however,
1616
at time of writing, only
1717
the [Go](https://github.com/kubernetes/client-go) and
1818
[Python](https://github.com/kubernetes-client/python/) clients are documented to support accessing CRDs.

0 commit comments

Comments
 (0)