New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Datadog GlobalTags support #9266
Conversation
83bc159
to
513171f
Compare
6fd34b4
to
91f364d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
91f364d
to
5458a9d
Compare
pkg/tracing/datadog/datadog.go
Outdated
if c.GlobalTag != "" { | ||
log.WithoutContext().Warn(`Datadog: option "globalTag" is deprecated, please use "globalTags" instead.`) | ||
|
||
value := "" | ||
if len(tag) == 2 { | ||
value = tag[1] | ||
key, value, _ := strings.Cut(c.GlobalTag, ":") | ||
|
||
// Don't override a tag already defined with the new option. | ||
if _, ok := c.GlobalTags[key]; !ok { | ||
if c.GlobalTags == nil { | ||
c.GlobalTags = make(map[string]string) | ||
} | ||
|
||
c.GlobalTags[key] = value | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
imho, it would have been better to make them mutually exclusive as soon as possible in the flow. It is highly unlikely the user purposefully uses both options at the same time, so we would do them a favor by detecting it, telling them to clean up their conf, and stopping.
But whatever, the option is going to disappear soon anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 minors suggestions
12f817d
to
caa364a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👏
What does this PR do?
This PR adds a new
GlobalTags
option for Datadog tracing.The previous
GlobalTag
option has been deprecated.Motivation
More
[ ] Added/updated tests[ ] Added/updated documentationAdditional Notes