mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
add forward/upstream metadata (#4521)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
@@ -14,6 +14,7 @@ import (
|
||||
"github.com/coredns/coredns/plugin"
|
||||
"github.com/coredns/coredns/plugin/debug"
|
||||
"github.com/coredns/coredns/plugin/dnstap"
|
||||
"github.com/coredns/coredns/plugin/metadata"
|
||||
clog "github.com/coredns/coredns/plugin/pkg/log"
|
||||
"github.com/coredns/coredns/request"
|
||||
|
||||
@@ -122,6 +123,10 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
|
||||
ctx = ot.ContextWithSpan(ctx, child)
|
||||
}
|
||||
|
||||
metadata.SetValueFunc(ctx, "forward/upstream", func() string {
|
||||
return proxy.addr
|
||||
})
|
||||
|
||||
var (
|
||||
ret *dns.Msg
|
||||
err error
|
||||
|
||||
Reference in New Issue
Block a user