Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate prometheus bucket functionality to kube-metrics for proxy metrics #82736

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion pkg/proxy/metrics/BUILD
Expand Up @@ -8,7 +8,6 @@ go_library(
deps = [
"//staging/src/k8s.io/component-base/metrics:go_default_library",
"//staging/src/k8s.io/component-base/metrics/legacyregistry:go_default_library",
"//vendor/github.com/prometheus/client_golang/prometheus:go_default_library",
],
)

Expand Down
14 changes: 6 additions & 8 deletions pkg/proxy/metrics/metrics.go
Expand Up @@ -20,8 +20,6 @@ import (
"sync"
"time"

"github.com/prometheus/client_golang/prometheus"

"k8s.io/component-base/metrics"
"k8s.io/component-base/metrics/legacyregistry"
)
Expand All @@ -35,7 +33,7 @@ var (
Subsystem: kubeProxySubsystem,
Name: "sync_proxy_rules_duration_seconds",
Help: "SyncProxyRules latency in seconds",
Buckets: prometheus.ExponentialBuckets(0.001, 2, 15),
Buckets: metrics.ExponentialBuckets(0.001, 2, 15),
StabilityLevel: metrics.ALPHA,
},
)
Expand All @@ -46,7 +44,7 @@ var (
Subsystem: kubeProxySubsystem,
Name: "sync_proxy_rules_latency_microseconds",
Help: "(Deprecated) SyncProxyRules latency in microseconds",
Buckets: prometheus.ExponentialBuckets(1000, 2, 15),
Buckets: metrics.ExponentialBuckets(1000, 2, 15),
StabilityLevel: metrics.ALPHA,
},
)
Expand Down Expand Up @@ -75,10 +73,10 @@ var (
Name: "network_programming_duration_seconds",
Help: "In Cluster Network Programming Latency in seconds",
Buckets: merge(
prometheus.LinearBuckets(0.25, 0.25, 2), // 0.25s, 0.50s
prometheus.LinearBuckets(1, 1, 59), // 1s, 2s, 3s, ... 59s
prometheus.LinearBuckets(60, 5, 12), // 60s, 65s, 70s, ... 115s
prometheus.LinearBuckets(120, 30, 7), // 2min, 2.5min, 3min, ..., 5min
metrics.LinearBuckets(0.25, 0.25, 2), // 0.25s, 0.50s
metrics.LinearBuckets(1, 1, 59), // 1s, 2s, 3s, ... 59s
metrics.LinearBuckets(60, 5, 12), // 60s, 65s, 70s, ... 115s
metrics.LinearBuckets(120, 30, 7), // 2min, 2.5min, 3min, ..., 5min
),
StabilityLevel: metrics.ALPHA,
},
Expand Down