aboutsummaryrefslogtreecommitdiff
path: root/plugin/kubernetes/object/metrics.go
diff options
context:
space:
mode:
authorGravatar Ben Kochie <superq@gmail.com> 2024-03-11 21:09:09 +0100
committerGravatar GitHub <noreply@github.com> 2024-03-11 16:09:09 -0400
commit0d6e113f9036596df3e291028ad9ffbbdca9677e (patch)
tree5abb58200b7e97d55cf773e6519c7c225d888bf1 /plugin/kubernetes/object/metrics.go
parenta4cbd95795d4d5cd69ddd6628eb254fade3b6037 (diff)
downloadcoredns-0d6e113f9036596df3e291028ad9ffbbdca9677e.tar.gz
coredns-0d6e113f9036596df3e291028ad9ffbbdca9677e.tar.zst
coredns-0d6e113f9036596df3e291028ad9ffbbdca9677e.zip
Enable Prometheus native histograms (#6524)
Add a NativeHistogramBucketFactor parameter to the use of `NewHistogramVec` in order to enable use of Prometheus Native Histograms. This will store automatically computed sparse buckets in CoreDNS. If a compatible Prometeus requests native histograms this data will returned instead of the static buckets. The default factor of 1.05 should provide high quality resolution data. Signed-off-by: SuperQ <superq@gmail.com>
Diffstat (limited to 'plugin/kubernetes/object/metrics.go')
-rw-r--r--plugin/kubernetes/object/metrics.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/kubernetes/object/metrics.go b/plugin/kubernetes/object/metrics.go
index f39744b8a..149648411 100644
--- a/plugin/kubernetes/object/metrics.go
+++ b/plugin/kubernetes/object/metrics.go
@@ -29,8 +29,9 @@ var (
Subsystem: "kubernetes",
Name: "dns_programming_duration_seconds",
// From 1 millisecond to ~17 minutes.
- Buckets: prometheus.ExponentialBuckets(0.001, 2, 20),
- Help: "Histogram of the time (in seconds) it took to program a dns instance.",
+ Buckets: prometheus.ExponentialBuckets(0.001, 2, 20),
+ NativeHistogramBucketFactor: plugin.NativeHistogramBucketFactor,
+ Help: "Histogram of the time (in seconds) it took to program a dns instance.",
}, []string{"service_kind"})
// DurationSinceFunc returns the duration elapsed since the given time.