aboutsummaryrefslogtreecommitdiff
path: root/core/dnsserver/server.go
diff options
context:
space:
mode:
authorGravatar John Belamaric <jbelamaric@infoblox.com> 2017-03-01 10:41:54 -0500
committerGravatar GitHub <noreply@github.com> 2017-03-01 10:41:54 -0500
commit9ea8cde36e24cb68d6cb2c5db7b6b08e204db7a8 (patch)
treee2ed28202d4e047d1ffcbecf797d1e04bdc9d068 /core/dnsserver/server.go
parent0a4903571e85d985f1789aa8f15465337bea9a84 (diff)
downloadcoredns-9ea8cde36e24cb68d6cb2c5db7b6b08e204db7a8.tar.gz
coredns-9ea8cde36e24cb68d6cb2c5db7b6b08e204db7a8.tar.zst
coredns-9ea8cde36e24cb68d6cb2c5db7b6b08e204db7a8.zip
Grpc tracing (#544)
* checkpoint * Pass context through ServeDNS, enable gRPC tracing * Fix types and make tracer available to proxy. go fmt * Fix imports * Use the DoNotStartTrace option * Change to SpanFilter from DoNotStartTrace * Use new name (IncludeSpan) * Final names * Add tests; fix possible client/conn leaks in grpc * go fmt
Diffstat (limited to 'core/dnsserver/server.go')
-rw-r--r--core/dnsserver/server.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/dnsserver/server.go b/core/dnsserver/server.go
index bb8a80d79..4906571e6 100644
--- a/core/dnsserver/server.go
+++ b/core/dnsserver/server.go
@@ -155,6 +155,10 @@ func (s *Server) Address() string { return s.Addr }
// defined in the request so that the correct zone
// (configuration and middleware stack) will handle the request.
func (s *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
+ s.ServeDNSWithContext(context.Background(), w, r)
+}
+
+func (s *Server) ServeDNSWithContext(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) {
defer func() {
// In case the user doesn't enable error middleware, we still
// need to make sure that we stay alive up here
@@ -171,7 +175,6 @@ func (s *Server) ServeDNS(w dns.ResponseWriter, r *dns.Msg) {
q := r.Question[0].Name
b := make([]byte, len(q))
off, end := 0, false
- ctx := context.Background()
var dshandler *Config