Skip to content
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

ddtrace/tracer: updated DD_TAGS parsing to support space separation #837

Merged
merged 4 commits into from
Feb 10, 2021

Conversation

dianashevchenko
Copy link
Contributor

DD_TAGS were split by commas only. Unless there is a comma in a string, tag list will be split by spaces. In either case, commas/spaces will be trimmed.

DD_TAGS were split by commas only. Unless there is a comma in a string, tag list will be split by spaces. In either case, commas/spaces will be trimmed.
@gbbr gbbr changed the title Updated DD_TAGS parsing to support space separation ddtrace/tracer: updated DD_TAGS parsing to support space separation Feb 9, 2021
ddtrace/tracer/option_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
ddtrace/tracer/option.go Outdated Show resolved Hide resolved
ddtrace/tracer/option.go Show resolved Hide resolved
in: "a,1",
expected: map[string]string{
"a": "",
"1": ""},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This curly brace should also go on the next line everywhere. Sorry if my initial message was unclear.

os.Setenv("DD_TAGS", tag.in)
c := newConfig()
for key, expected := range tag.expected {
actual, ok := c.globalTags[key]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
actual, ok := c.globalTags[key]
v, ok := c.globalTags[key]

Can we please use v or got?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v is used everywhere above, so I did not change that

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

ddtrace/tracer/option_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/option_test.go Outdated Show resolved Hide resolved
ddtrace/tracer/option_test.go Show resolved Hide resolved
ddtrace/tracer/option_test.go Outdated Show resolved Hide resolved
profiler/options.go Outdated Show resolved Hide resolved
@gbbr gbbr modified the milestone: 1.29.0 Feb 9, 2021
Refactored parsing tests, removed comma trimming in the profiler/options.go.
Copy link
Contributor

@gbbr gbbr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect to me. CI is not passing though, there's one check you missed....

@dianashevchenko dianashevchenko added this to the 1.29.0 milestone Feb 10, 2021
@gbbr gbbr merged commit c1edb6e into v1 Feb 10, 2021
@gbbr gbbr deleted the shevchenko/parse-dd-tags branch February 10, 2021 15:02
This was referenced Mar 11, 2021
This was referenced Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants