mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Add proto and remote tags to trace plugin (#4159)
* Add proto and client-ip trace tags Signed-off-by: Adam Malcontenti-Wilson <amalcontenti-wilson@zendesk.com> * Commit my own suggestion Signed-off-by: Miek Gieben <miek@miek.nl> Co-authored-by: Adam Malcontenti-Wilson <amalcontenti-wilson@zendesk.com>
This commit is contained in:
@@ -25,9 +25,11 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
tagName = "coredns.io/name"
|
||||
tagType = "coredns.io/type"
|
||||
tagRcode = "coredns.io/rcode"
|
||||
tagName = "coredns.io/name"
|
||||
tagType = "coredns.io/type"
|
||||
tagRcode = "coredns.io/rcode"
|
||||
tagProto = "coredns.io/proto"
|
||||
tagRemote = "coredns.io/remote"
|
||||
)
|
||||
|
||||
type trace struct {
|
||||
@@ -107,6 +109,8 @@ func (t *trace) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||
|
||||
span.SetTag(tagName, req.Name())
|
||||
span.SetTag(tagType, req.Type())
|
||||
span.SetTag(tagProto, req.Proto())
|
||||
span.SetTag(tagRemote, req.IP())
|
||||
span.SetTag(tagRcode, rcode.ToString(rw.Rcode))
|
||||
|
||||
return status, err
|
||||
|
||||
Reference in New Issue
Block a user