Skip to content

Commit

Permalink
fix k8s latency metrics label cardinality
Browse files Browse the repository at this point in the history
The functionality provided by the finalURLTemplate is still used by
Cilium to track the request latency for requests performed to
Kubernetes. Until this is reverted upstream we will maintain this fork
with this change so that we can still used the functionality provided by
finalURLTemplate.

This functionality prevents the explosion of label cardinality in
prometheus metrics since it aggregates in a way that common URLs
requests will be reported as being the same.

Signed-off-by: André Martins <[email protected]>
  • Loading branch information
aanm committed Aug 9, 2022
1 parent b260d7a commit 4ad5e94
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 10 deletions.
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ replace (

go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20220713202445-9066eee9e0be

k8s.io/client-go => github.com/cilium/client-go v0.0.0-20220808211112-706606a736d5

// Using private fork of controller-tools. See commit msg for more context
// as to why we are using a private fork.
sigs.k8s.io/controller-tools => github.com/cilium/controller-tools v0.6.2
Expand Down
9 changes: 2 additions & 7 deletions go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 80 additions & 2 deletions vendor/k8s.io/client-go/rest/request.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,7 @@ k8s.io/apimachinery/pkg/version
k8s.io/apimachinery/pkg/watch
k8s.io/apimachinery/third_party/forked/golang/json
k8s.io/apimachinery/third_party/forked/golang/reflect
# k8s.io/client-go v0.24.2
# k8s.io/client-go v0.24.2 => github.com/cilium/client-go v0.0.0-20220808211112-706606a736d5
## explicit; go 1.16
k8s.io/client-go/applyconfigurations/admissionregistration/v1
k8s.io/client-go/applyconfigurations/admissionregistration/v1beta1
Expand Down Expand Up @@ -1685,4 +1685,5 @@ sigs.k8s.io/yaml
# github.com/miekg/dns => github.com/cilium/dns v1.1.4-0.20190417235132-8e25ec9a0ff3
# github.com/optiopay/kafka => github.com/cilium/kafka v0.0.0-20180809090225-01ce283b732b
# go.universe.tf/metallb => github.com/cilium/metallb v0.1.1-0.20220713202445-9066eee9e0be
# k8s.io/client-go => github.com/cilium/client-go v0.0.0-20220808211112-706606a736d5
# sigs.k8s.io/controller-tools => github.com/cilium/controller-tools v0.6.2

0 comments on commit 4ad5e94

Please sign in to comment.