Commit 32cc745d authored by Chris O'Haver's avatar Chris O'Haver Committed by GitHub

add forward/upstream metadata (#4521)

Signed-off-by: default avatarChris O'Haver <cohaver@infoblox.com>
parent a2b34a23
...@@ -14,6 +14,7 @@ import ( ...@@ -14,6 +14,7 @@ import (
"github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/debug" "github.com/coredns/coredns/plugin/debug"
"github.com/coredns/coredns/plugin/dnstap" "github.com/coredns/coredns/plugin/dnstap"
"github.com/coredns/coredns/plugin/metadata"
clog "github.com/coredns/coredns/plugin/pkg/log" clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
...@@ -122,6 +123,10 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg ...@@ -122,6 +123,10 @@ func (f *Forward) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
ctx = ot.ContextWithSpan(ctx, child) ctx = ot.ContextWithSpan(ctx, child)
} }
metadata.SetValueFunc(ctx, "forward/upstream", func() string {
return proxy.addr
})
var ( var (
ret *dns.Msg ret *dns.Msg
err error err error
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment