aboutsummaryrefslogtreecommitdiff
path: root/middleware/httpproxy/metrics.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2017-02-06 19:32:48 +0000
committerGravatar GitHub <noreply@github.com> 2017-02-06 19:32:48 +0000
commit123a76c91ead7fb57e801f974a16fc3ab8312c0d (patch)
tree0b84ec261ad06e8e747c154264fca84043d07aaa /middleware/httpproxy/metrics.go
parent77f957d443f9c287abc1f315cebc0c725e9e4ba0 (diff)
downloadcoredns-123a76c91ead7fb57e801f974a16fc3ab8312c0d.tar.gz
coredns-123a76c91ead7fb57e801f974a16fc3ab8312c0d.tar.zst
coredns-123a76c91ead7fb57e801f974a16fc3ab8312c0d.zip
middleware/proxy: absorb httpproxy (#481)
* middleware/proxy: absorb httpproxy Move the httproxy into proxy. This adds and Exchanger interface which is used to exchange the messages with the upstream. The https_google upstream will re-resolve itself and update the upstream hosts used every 300s. * Remove and add TODO
Diffstat (limited to 'middleware/httpproxy/metrics.go')
-rw-r--r--middleware/httpproxy/metrics.go32
1 files changed, 0 insertions, 32 deletions
diff --git a/middleware/httpproxy/metrics.go b/middleware/httpproxy/metrics.go
deleted file mode 100644
index c3822e523..000000000
--- a/middleware/httpproxy/metrics.go
+++ /dev/null
@@ -1,32 +0,0 @@
-package httpproxy
-
-import (
- "sync"
-
- "github.com/miekg/coredns/middleware"
-
- "github.com/prometheus/client_golang/prometheus"
-)
-
-// Metrics the httpproxy middleware exports.
-var (
- RequestDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{
- Namespace: middleware.Namespace,
- Subsystem: subsystem,
- 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"})
-)
-
-// OnStartupMetrics sets up the metrics on startup.
-func OnStartupMetrics() error {
- metricsOnce.Do(func() {
- prometheus.MustRegister(RequestDuration)
- })
- return nil
-}
-
-var metricsOnce sync.Once
-
-const subsystem = "httpproxy"