aboutsummaryrefslogtreecommitdiff
path: root/middleware/proxy/metrics.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-01-15 08:12:58 +0000
committerGravatar GitHub <noreply@github.com> 2017-01-15 08:12:58 +0000
commit52e01264e8a5901209f83335aa96e091c93ced7e (patch)
tree433625011d8ce8f041147ec4ef171d55678be2be /middleware/proxy/metrics.go
parenta6d232a622a2f83a5d5ea1d9d946da7f910a0f9e (diff)
downloadcoredns-52e01264e8a5901209f83335aa96e091c93ced7e.tar.gz
coredns-52e01264e8a5901209f83335aa96e091c93ced7e.tar.zst
coredns-52e01264e8a5901209f83335aa96e091c93ced7e.zip
middleware/proxy: implement Exchanger (#480)
By defining and using an proxy.Exchanger interface we make the proxy more generic and we can then fold back httproxy into proxy. This overrides #463 and #473 and should make futures extensions rather trivial * Add docs that talk about `protocol` and how to set it. * middleware/proxy: rename New to NewLookup It's used as a Lookup mechanism not as a completely new proxy, reflect that in the name. * Set maxfails to 3 by default when looking up names. Most of the changes have been copied from https://github.com/johnbelamaric/coredns/pull/1/files
Diffstat (limited to 'middleware/proxy/metrics.go')
-rw-r--r--middleware/proxy/metrics.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/middleware/proxy/metrics.go b/middleware/proxy/metrics.go
index f3112dd76..a2205c692 100644
--- a/middleware/proxy/metrics.go
+++ b/middleware/proxy/metrics.go
@@ -12,14 +12,14 @@ import (
var (
RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
Namespace: middleware.Namespace,
- Subsystem: subsystem,
+ Subsystem: "proxy",
Name: "request_duration_milliseconds",
Buckets: append(prometheus.DefBuckets, []float64{50, 100, 200, 500, 1000, 2000, 3000, 4000, 5000, 10000}...),
Help: "Histogram of the time (in milliseconds) each request took.",
- }, []string{"zone"})
+ }, []string{"protocol", "zone"})
)
-// OnStartup sets up the metrics on startup.
+// OnStartup sets up the metrics on startup. This is done for all proxy protocols.
func OnStartup() error {
metricsOnce.Do(func() {
prometheus.MustRegister(RequestDuration)
@@ -28,5 +28,3 @@ func OnStartup() error {
}
var metricsOnce sync.Once
-
-const subsystem = "proxy"