Disable debug mode for tracing - removes extra logging (#4016)

Signed-off-by: Oleg Atamanenko <oleg.atamanenko@gmail.com>
This commit is contained in:
Oleg Atamanenko 2020-07-23 00:40:17 -07:00 committed by GitHub
parent 8c6d016ad6
commit c86be3428a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View file

@ -7,6 +7,7 @@
## Description ## Description
With *trace* you enable OpenTracing of how a request flows through CoreDNS. With *trace* you enable OpenTracing of how a request flows through CoreDNS.
Enable *debug* plugin to get logs from the trace plugin.
## Syntax ## Syntax
@ -84,3 +85,7 @@ trace tracinghost:9411 {
client_server client_server
} }
~~~ ~~~
## Also See
See the *debug* plugin for more information about debug logging.

View file

@ -10,6 +10,7 @@ import (
"github.com/coredns/coredns/plugin" "github.com/coredns/coredns/plugin"
"github.com/coredns/coredns/plugin/metrics" "github.com/coredns/coredns/plugin/metrics"
"github.com/coredns/coredns/plugin/pkg/dnstest" "github.com/coredns/coredns/plugin/pkg/dnstest"
"github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/plugin/pkg/rcode" "github.com/coredns/coredns/plugin/pkg/rcode"
_ "github.com/coredns/coredns/plugin/pkg/trace" // Plugin the trace package. _ "github.com/coredns/coredns/plugin/pkg/trace" // Plugin the trace package.
"github.com/coredns/coredns/request" "github.com/coredns/coredns/request"
@ -52,7 +53,7 @@ func (t *trace) OnStartup() error {
case "zipkin": case "zipkin":
err = t.setupZipkin() err = t.setupZipkin()
case "datadog": case "datadog":
tracer := opentracer.New(tracer.WithAgentAddr(t.Endpoint), tracer.WithServiceName(t.serviceName), tracer.WithDebugMode(true)) tracer := opentracer.New(tracer.WithAgentAddr(t.Endpoint), tracer.WithServiceName(t.serviceName), tracer.WithDebugMode(log.D.Value()))
t.tracer = tracer t.tracer = tracer
default: default:
err = fmt.Errorf("unknown endpoint type: %s", t.EndpointType) err = fmt.Errorf("unknown endpoint type: %s", t.EndpointType)