mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 00:04:15 -04:00
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>
This commit is contained in:
@@ -67,11 +67,12 @@ func (h *health) overloaded(ctx context.Context) {
|
||||
var (
|
||||
// HealthDuration is the metric used for exporting how fast we can retrieve the /health endpoint.
|
||||
HealthDuration = promauto.NewHistogram(prometheus.HistogramOpts{
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "health",
|
||||
Name: "request_duration_seconds",
|
||||
Buckets: plugin.SlimTimeBuckets,
|
||||
Help: "Histogram of the time (in seconds) each request took.",
|
||||
Namespace: plugin.Namespace,
|
||||
Subsystem: "health",
|
||||
Name: "request_duration_seconds",
|
||||
Buckets: plugin.SlimTimeBuckets,
|
||||
NativeHistogramBucketFactor: plugin.NativeHistogramBucketFactor,
|
||||
Help: "Histogram of the time (in seconds) each request took.",
|
||||
})
|
||||
// HealthFailures is the metric used to count how many times the health request failed
|
||||
HealthFailures = promauto.NewCounter(prometheus.CounterOpts{
|
||||
|
||||
Reference in New Issue
Block a user