Follow up on PR 2868 (#2877)

This fix is a follow up on comment https://github.com/coredns/coredns/pull/2868#discussion_r291609761

Signed-off-by: Yong Tang <yong.tang.github@outlook.com>
This commit is contained in:
Yong Tang
2019-06-10 02:02:03 -07:00
committed by Miek Gieben
parent 60f483e98b
commit f13482f4d1
3 changed files with 43 additions and 14 deletions

View File

@@ -54,7 +54,8 @@ func (t *trace) OnStartup() error {
case "zipkin":
err = t.setupZipkin()
case "datadog":
t.setupDatadog()
tracer := opentracer.New(tracer.WithAgentAddr(t.Endpoint), tracer.WithServiceName(t.serviceName), tracer.WithDebugMode(true))
t.tracer = tracer
default:
err = fmt.Errorf("unknown endpoint type: %s", t.EndpointType)
}
@@ -75,11 +76,6 @@ func (t *trace) setupZipkin() error {
return err
}
func (t *trace) setupDatadog() {
tracer := opentracer.New(tracer.WithAgentAddr(t.Endpoint), tracer.WithServiceName(t.serviceName), tracer.WithDebugMode(true))
t.tracer = tracer
}
// Name implements the Handler interface.
func (t *trace) Name() string { return "trace" }