git » dnss » commit 1e7001f

Adjust monitoring URLs and tracing names

author Alberto Bertogli
2018-04-14 10:04:01 UTC
committer Alberto Bertogli
2018-04-14 10:04:01 UTC
parent 570143d09eea232990b300f4cb0bf5d2a4843c4c

Adjust monitoring URLs and tracing names

After the recent package renames, some monitoring URLs and tracing names
have become obsolete. This patch fixes them up to match the current
names and structure of the codebase.

dnss.go +3 -3
internal/dnsserver/resolver.go +3 -3
internal/dnsserver/server.go +1 -1

diff --git a/dnss.go b/dnss.go
index 2ec1f52..f182ab1 100644
--- a/dnss.go
+++ b/dnss.go
@@ -223,10 +223,10 @@ const monitoringHTMLIndex = `<!DOCTYPE html>
           <small><a href="https://godoc.org/golang.org/x/net/trace">
             (ref)</a></small>
         <ul>
-          <li><a href="/debug/requests?fam=dnstohttp&b=11">dnstohttp latency</a>
-          <li><a href="/debug/requests?fam=dnstohttp&b=0&exp=1">dnstohttp trace</a>
+          <li><a href="/debug/requests?fam=dnsserver&b=11">dns server latency</a>
+          <li><a href="/debug/requests?fam=dnsserver&b=0&exp=1">dns server trace</a>
         </ul>
-      <li><a href="/debug/dnstohttp/cache/dump">cache dump</a>
+      <li><a href="/debug/dnsserver/cache/dump">cache dump</a>
       <li><a href="/debug/pprof">pprof</a>
           <small><a href="https://golang.org/pkg/net/http/pprof/">
             (ref)</a></small>
diff --git a/internal/dnsserver/resolver.go b/internal/dnsserver/resolver.go
index 94dc3a3..0b588f9 100644
--- a/internal/dnsserver/resolver.go
+++ b/internal/dnsserver/resolver.go
@@ -110,8 +110,8 @@ func (c *cachingResolver) Init() error {
 // Note these are global by nature, if you try to register them multiple
 // times, you will get a panic.
 func (c *cachingResolver) RegisterDebugHandlers() {
-	http.HandleFunc("/debug/dnstohttps/cache/dump", c.DumpCache)
-	http.HandleFunc("/debug/dnstohttps/cache/flush", c.FlushCache)
+	http.HandleFunc("/debug/dnsserver/cache/dump", c.DumpCache)
+	http.HandleFunc("/debug/dnsserver/cache/flush", c.FlushCache)
 }
 
 func (c *cachingResolver) DumpCache(w http.ResponseWriter, r *http.Request) {
@@ -157,7 +157,7 @@ func (c *cachingResolver) Maintain() {
 	go c.back.Maintain()
 
 	for range time.Tick(maintenancePeriod) {
-		tr := trace.New("dnstohttps.Cache", "GC")
+		tr := trace.New("dnsserver.Cache", "GC")
 		var total, expired int
 
 		c.mu.Lock()
diff --git a/internal/dnsserver/server.go b/internal/dnsserver/server.go
index 6f817fa..d4e84ff 100644
--- a/internal/dnsserver/server.go
+++ b/internal/dnsserver/server.go
@@ -75,7 +75,7 @@ func (s *Server) SetFallback(upstream string, domains []string) {
 
 // Handler for the incoming DNS queries.
 func (s *Server) Handler(w dns.ResponseWriter, r *dns.Msg) {
-	tr := trace.New("dnstohttp", "Handler")
+	tr := trace.New("dnsserver", "Handler")
 	defer tr.Finish()
 
 	tr.LazyPrintf("from:%v   id:%v", w.RemoteAddr(), r.Id)