Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 new parser for
DD_TAGS
and prioritizingDD_SERVICE
#8296base: master
Are you sure you want to change the base?
Add new parser for
DD_TAGS
and prioritizingDD_SERVICE
#8296Changes from 12 commits
04cc577
5cbca2c
96be6c8
79e12ea
8c6cbaa
f31e8e8
61d1d4d
dee14ce
bf49e20
8bef8d0
5dbe976
798b8d8
32e9861
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I think putting tag name conditional logic in this method is not durable. Instead, what about just calling
parseTraceTagsMap
from the config class where those tags are extracted?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.
This would involve creating a new
getMergedMap
to lettrace.tags
take precedence overtags
. This seems a little repetitive to me, but I agree that the conditional logic used currently isn't the best. I'm wondering if there is an alternate solution for this? WDYT?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.
that argument does not look used in that method
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.
If I understood well the code I think you should retain the separator that comes first (the smaller indexof) and you should'n break here. For instance if you have
mykeys abc,d
the separator used is space but if the method is called withargSeparator = [',', ' ']
This code will detect the comma as the separator while it does not look so.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.
The intended behavior is that if a comma exists at all within the input, we would want to split by comma, regardless of which separator comes first. That is why we iterate through an ordered list of separators that are ordered by priority of which separator we'd rather use.
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.
it looks confusing since the space is allowed and nothing prevent to a value to contain a comma
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.
Hmm I'm not sure what you mean here. This loop here is solely to determine whether we want to separate by comma or separate by space. When we iterate through the input, we take each substring (separated by the
argSeparator
) and then check for K/V then, meaning that the potential value would stop at theargSeparator
. Let me know if that makes sense or if you have more questions!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.
If you run that code like this:
loadTraceTagsMap(map, "k1=v1 k2=v2,v3", '=', List.of(',', ' '));
the result is{k1=v1 k2=v2, v3=}
The separator used is
,
but the first one would have been aspace
.The comment in the code says:
// find the first instance of the first possible separator
.I perhaps misunderstood, but the first possible would have been a space and not a comma.