Skip to content

Commit 901102a

Browse files
adopt native histograms for admission histogram
1 parent d5a6f86 commit 901102a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/webhook/internal/metrics/metrics.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package metrics
1818

1919
import (
2020
"net/http"
21+
"time"
2122

2223
"github.com/prometheus/client_golang/prometheus"
2324
"github.com/prometheus/client_golang/prometheus/promhttp"
@@ -30,8 +31,11 @@ var (
3031
// of processing admission requests.
3132
RequestLatency = prometheus.NewHistogramVec(
3233
prometheus.HistogramOpts{
33-
Name: "controller_runtime_webhook_latency_seconds",
34-
Help: "Histogram of the latency of processing admission requests",
34+
Name: "controller_runtime_webhook_latency_seconds",
35+
Help: "Histogram of the latency of processing admission requests",
36+
NativeHistogramBucketFactor: 1.1,
37+
NativeHistogramMaxBucketNumber: 100,
38+
NativeHistogramMinResetDuration: 1 * time.Hour,
3539
},
3640
[]string{"webhook"},
3741
)

0 commit comments

Comments
 (0)