aboutsummaryrefslogtreecommitdiff
path: root/plugin/plugin.go
diff options
context:
space:
mode:
authorGravatar Ben Kochie <superq@gmail.com> 2021-05-27 15:16:38 +0200
committerGravatar GitHub <noreply@github.com> 2021-05-27 15:16:38 +0200
commit9edfaed6311a993d520094ebe691bc36ef379371 (patch)
tree662ec52fb6997d9f34f549756673d9054768b275 /plugin/plugin.go
parent4c0fdc390950694b40c75686bc7549e48f430ff2 (diff)
downloadcoredns-9edfaed6311a993d520094ebe691bc36ef379371.tar.gz
coredns-9edfaed6311a993d520094ebe691bc36ef379371.tar.zst
coredns-9edfaed6311a993d520094ebe691bc36ef379371.zip
Reduce the cardinality of health endpoint metrics (#4650)
The health endpoint histogram has a large amount of cardinality for a simple endpoint. Introduce a new "Slim" set of buckets for `/health` to reduce the metrics load on large deployments. Especially those that have per-node DNS caching services. Add a metric to count internal health check failures rather than use the timeout value as side effect monitor of the check error. This avoids incorrectly recording the timeout value if there is an error that is not a timeout (ex. refused) Signed-off-by: SuperQ <superq@gmail.com>
Diffstat (limited to 'plugin/plugin.go')
-rw-r--r--plugin/plugin.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/plugin.go b/plugin/plugin.go
index 9bac48885..51f5ba79c 100644
--- a/plugin/plugin.go
+++ b/plugin/plugin.go
@@ -105,5 +105,8 @@ const Namespace = "coredns"
// TimeBuckets is based on Prometheus client_golang prometheus.DefBuckets
var TimeBuckets = prometheus.ExponentialBuckets(0.00025, 2, 16) // from 0.25ms to 8 seconds
+// SlimTimeBuckets is low cardinality set of duration buckets.
+var SlimTimeBuckets = prometheus.ExponentialBuckets(0.00025, 10, 5) // from 0.25ms to 2.5 seconds
+
// ErrOnce is returned when a plugin doesn't support multiple setups per server.
var ErrOnce = errors.New("this plugin can only be used once per Server Block")