Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
traefik
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
containous
traefik
Commits
e77a66c2
Unverified
Commit
e77a66c2
authored
Dec 6, 2023
by
Suyash Choudhary
Committed by
GitHub
Dec 6, 2023
Browse files
Options
Downloads
Patches
Plain Diff
Fixed datadog logs json format issue
parent
dae0491b
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
pkg/log/datadog.go
+13
-0
13 additions, 0 deletions
pkg/log/datadog.go
pkg/tracing/datadog/datadog.go
+4
-0
4 additions, 0 deletions
pkg/tracing/datadog/datadog.go
with
17 additions
and
0 deletions
pkg/log/datadog.go
0 → 100644
+
13
−
0
View file @
e77a66c2
package
log
type
DatadogLogger
struct
{
logger
Logger
}
func
NewDatadogLogger
(
logger
Logger
)
*
DatadogLogger
{
return
&
DatadogLogger
{
logger
:
logger
}
}
func
(
d
DatadogLogger
)
Log
(
msg
string
)
{
d
.
logger
.
Debug
(
msg
)
}
This diff is collapsed.
Click to expand it.
pkg/tracing/datadog/datadog.go
+
4
−
0
View file @
e77a66c2
package
datadog
package
datadog
import
(
import
(
"context"
"io"
"io"
"net"
"net"
"os"
"os"
...
@@ -47,6 +48,8 @@ func (c *Config) SetDefaults() {
...
@@ -47,6 +48,8 @@ func (c *Config) SetDefaults() {
// Setup sets up the tracer.
// Setup sets up the tracer.
func
(
c
*
Config
)
Setup
(
serviceName
string
)
(
opentracing
.
Tracer
,
io
.
Closer
,
error
)
{
func
(
c
*
Config
)
Setup
(
serviceName
string
)
(
opentracing
.
Tracer
,
io
.
Closer
,
error
)
{
ctx
:=
log
.
With
(
context
.
Background
(),
log
.
Str
(
log
.
MetricsProviderName
,
"datadog"
))
opts
:=
[]
datadog
.
StartOption
{
opts
:=
[]
datadog
.
StartOption
{
datadog
.
WithService
(
serviceName
),
datadog
.
WithService
(
serviceName
),
datadog
.
WithDebugMode
(
c
.
Debug
),
datadog
.
WithDebugMode
(
c
.
Debug
),
...
@@ -56,6 +59,7 @@ func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error
...
@@ -56,6 +59,7 @@ func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error
PriorityHeader
:
c
.
SamplingPriorityHeaderName
,
PriorityHeader
:
c
.
SamplingPriorityHeaderName
,
BaggagePrefix
:
c
.
BagagePrefixHeaderName
,
BaggagePrefix
:
c
.
BagagePrefixHeaderName
,
})),
})),
datadog
.
WithLogger
(
log
.
NewDatadogLogger
(
log
.
FromContext
(
ctx
))),
}
}
if
c
.
LocalAgentSocket
!=
""
{
if
c
.
LocalAgentSocket
!=
""
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment