aboutsummaryrefslogtreecommitdiff
path: root/plugin/grpc
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/grpc
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/grpc')
-rw-r--r--plugin/grpc/metrics.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/plugin/grpc/metrics.go b/plugin/grpc/metrics.go
index 2857042cd..0e8760acf 100644
--- a/plugin/grpc/metrics.go
+++ b/plugin/grpc/metrics.go
@@ -22,10 +22,11 @@ var (
Help: "Counter of requests made per upstream.",
}, []string{"rcode", "to"})
RequestDuration = promauto.NewHistogramVec(prometheus.HistogramOpts{
- Namespace: plugin.Namespace,
- Subsystem: "grpc",
- Name: "request_duration_seconds",
- Buckets: plugin.TimeBuckets,
- Help: "Histogram of the time each request took.",
+ Namespace: plugin.Namespace,
+ Subsystem: "grpc",
+ Name: "request_duration_seconds",
+ Buckets: plugin.TimeBuckets,
+ NativeHistogramBucketFactor: plugin.NativeHistogramBucketFactor,
+ Help: "Histogram of the time each request took.",
}, []string{"to"})
)