mirror of
				https://github.com/coredns/coredns.git
				synced 2025-10-27 08:14:18 -04:00 
			
		
		
		
	This reverts commit 8045aa279b.
			
			
This commit is contained in:
		| @@ -91,10 +91,6 @@ On each endpoint, the timeouts of the communication are set by default and autom | ||||
| * dialTimeout by default is 30 sec, and can decrease automatically down to 100ms | ||||
| * readTimeout by default is 2 sec, and can decrease automatically down to 200ms | ||||
|  | ||||
| ## Metadata | ||||
|  | ||||
| * forward/resolving_proxy : provide the IP address and port of the upstream resolver used to resolve the current DNS query. | ||||
|  | ||||
| ## Metrics | ||||
|  | ||||
| If monitoring is enabled (via the *prometheus* directive) then the following metric are exported: | ||||
|   | ||||
| @@ -12,7 +12,6 @@ import ( | ||||
|  | ||||
| 	"github.com/coredns/coredns/plugin" | ||||
| 	"github.com/coredns/coredns/plugin/debug" | ||||
| 	"github.com/coredns/coredns/plugin/metadata" | ||||
| 	clog "github.com/coredns/coredns/plugin/pkg/log" | ||||
| 	"github.com/coredns/coredns/request" | ||||
|  | ||||
| @@ -60,15 +59,6 @@ func (f *Forward) Len() int { return len(f.proxies) } | ||||
| // Name implements plugin.Handler. | ||||
| func (f *Forward) Name() string { return "forward" } | ||||
|  | ||||
| //declareMetadata adds to the context a metadata parameter which will return the passed value. | ||||
| func (f *Forward) declareMetadata(ctx context.Context, name string, value string) bool { | ||||
| 	label := f.Name()+"/"+name | ||||
| 	if metadata.IsLabel(label) { | ||||
| 		return metadata.SetValueFunc(ctx, label, func() string { return value }) | ||||
| 	} | ||||
| 	return false | ||||
| } | ||||
|  | ||||
| // ServeDNS implements plugin.Handler. | ||||
| func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) { | ||||
|  | ||||
| @@ -158,12 +148,10 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg | ||||
|  | ||||
| 			formerr := state.ErrorMessage(dns.RcodeFormatError) | ||||
| 			w.WriteMsg(formerr) | ||||
| 			f.declareMetadata(ctx, "resolving_proxy", proxy.addr) | ||||
| 			return 0, nil | ||||
| 		} | ||||
|  | ||||
| 		w.WriteMsg(ret) | ||||
| 		f.declareMetadata(ctx, "resolving_proxy", proxy.addr) | ||||
| 		return 0, nil | ||||
| 	} | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user