Skip to content

Commit

Permalink
Fix stackdriver distribution without bucket bounds
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
aLekSer committed Feb 4, 2019
1 parent bc75c34 commit 3a88e45
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/metrics/kubernetes_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func init() {
Name: "k8s_client_cache_list_items",
Measure: cacheListItemCountStats,
Description: "Count of items in a list from the Kubernetes API.",
Aggregation: view.Distribution(),
Aggregation: view.Distribution(0),
}))

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

runtime.Must(view.Register(&view.View{
Name: "k8s_client_cache_watch_events",
Measure: cacheItemsInWatchesCountStats,
Description: "Number of items in watches on the Kubernetes API.",
Aggregation: view.Distribution(),
Aggregation: view.Distribution(0),
}))

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

runtime.Must(view.Register(&view.View{
Name: "k8s_client_workqueue_work_duration_seconds",
Measure: workQueueWorkDurationStats,
Description: "How long processing an item from the work queue takes.",
Aggregation: view.Distribution(),
Aggregation: view.Distribution(0),
TagKeys: []tag.Key{keyQueueName},
}))

Expand Down

0 comments on commit 3a88e45

Please sign in to comment.