Fixed datadog logs json format issue
This commit is contained in:
parent
dae0491b61
commit
e77a66c2ac
2 changed files with 17 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
package datadog
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net"
|
||||
"os"
|
||||
|
@ -47,6 +48,8 @@ func (c *Config) SetDefaults() {
|
|||
|
||||
// Setup sets up the tracer.
|
||||
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
|
||||
ctx := log.With(context.Background(), log.Str(log.MetricsProviderName, "datadog"))
|
||||
|
||||
opts := []datadog.StartOption{
|
||||
datadog.WithService(serviceName),
|
||||
datadog.WithDebugMode(c.Debug),
|
||||
|
@ -56,6 +59,7 @@ func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error
|
|||
PriorityHeader: c.SamplingPriorityHeaderName,
|
||||
BaggagePrefix: c.BagagePrefixHeaderName,
|
||||
})),
|
||||
datadog.WithLogger(log.NewDatadogLogger(log.FromContext(ctx))),
|
||||
}
|
||||
|
||||
if c.LocalAgentSocket != "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue