-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Support collector tags, similar to agent tags #1854
Conversation
return b | ||
} | ||
|
||
// Parsing logic borrowed from jaegertracing/jaeger-client-go | ||
func parseAgentTags(agentTags string) map[string]string { |
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.
Note that this package currently has 100% coverage
$ go test -cover ./cmd/agent/app/reporter/
ok github.com/jaegertracing/jaeger/cmd/agent/app/reporter 0.069s coverage: 100.0% of statements
which means there is a test covering this function, which should also move to the new location.
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 am not sure if moving this test out of there is a good idea? It does what it should be doing, parses agent options with tags. I've added additional tests to cmd/flags
. I could remove TestBindFlags
test from cmd/agent/app/reporter/flags_test.go
but I think that would leave the actual option handling without coverage?
Moving the complete test from cmd/agent/app/reporter/flags_test.go
to cmd/flags/flags_test.go
does not seem to be an option as it results in circular import.
cmd/collector/app/span_processor.go
Outdated
@@ -159,6 +161,11 @@ func (sp *spanProcessor) enqueueSpan(span *model.Span, originalFormat SpanFormat | |||
//add format tag | |||
span.Tags = append(span.Tags, model.String("internal.span.format", string(originalFormat))) | |||
|
|||
// append the collector tags | |||
for k, v := range sp.collectorTags { |
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.
add // TODO add support for deduping tags, https://github.com/jaegertracing/jaeger/issues/1778
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.
Done. I have moved collector tags appending to a separate function to make it testable.
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.
Nice job, @radekg! This LGTM, just make sure to run make fmt
, as Travis is failing with:
Go fmt, license check, or import ordering failures, run 'make fmt'
Also, make sure to add a sign-off to your commit, otherwise the DCO check will fail. Click on "Details" for that check how to get that done.
d6e8587
to
2410270
Compare
@yurishkuro I'm not sure if the tests are failing because of my changes, first look suggests it's not my changes but I could be wrong. |
Codecov Report
@@ Coverage Diff @@
## master #1854 +/- ##
==========================================
- Coverage 98.44% 96.99% -1.45%
==========================================
Files 199 203 +4
Lines 9892 10061 +169
==========================================
+ Hits 9738 9759 +21
- Misses 118 264 +146
- Partials 36 38 +2
Continue to review full report at Codecov.
|
@radekg yes, the failure is due to this change, because in all-in-one the flags from agent and collector are combined.
|
The fuzzing job got cancelled because two previous jobs failed, which I manually restarted (and have now succeeded). I manually just triggered the fuzz job as well. |
Thank you @jpkrohling. Tests are passing now. This feature is complete and ready for review. @yurishkuro, I've renamed the collector flag to |
Wondering if would be better to call the new flag |
@objectiser this is a good idea, done in the latest commit. |
What is the motivation behind this? Both add tags to process object. |
Is it reasonable to assume a user might want to add certain tags on the agent and others on the collector? |
@pavolloffay When used together in the |
If they are in different processes, yes. If they are in the same process (all-in-one), I don't think it makes much sense to add tags to the agent and to the collector. |
If it is possible to skip adding the flag to the agent, when running inside |
There are 2 options here:
It is possible to find out if the flag was defined by using The question is: which solution is preferred. My preference would be to keep separate flags. |
Hi everyone, what's the status on this? It's not clear to me in what direction should this be taken. |
Sorry, I missed this one. I'd say that each can have its own flag, but the all-in-one should not accept the agent's flag. |
@jpkrohling |
…aegertracing#1832 (jaegertracing#1842) Signed-off-by: Michael Burman <[email protected]> Signed-off-by: radekg <[email protected]>
… 0 (jaegertracing#1868) Signed-off-by: Juraci Paixão Kröhling <[email protected]> Signed-off-by: radekg <[email protected]>
Signed-off-by: Pavol Loffay <[email protected]> Signed-off-by: radekg <[email protected]>
* Use Elasticsearch 6 in xdock Signed-off-by: Pavol Loffay <[email protected]> * Fix issues and use single node ES Signed-off-by: Pavol Loffay <[email protected]> Signed-off-by: radekg <[email protected]>
…rocess Signed-off-by: radekg <[email protected]>
Signed-off-by: radekg <[email protected]>
b9afa8e
to
944bebe
Compare
The build is failing with:
Is that new? I don't remember seeing this requirement before... |
Maybe something to do with code coverage running only on touched paths? Full run of tests covers this. I’ll add a test. |
It's now new, we had this validation for a long time. Go does not report coverage for packages with no tests, creating misleading numbers. A rudimentary test file would fix it. |
And directories with |
Yes but we should really get rid of those nocover files, since we relaxed 100% coverage requirement. |
Signed-off-by: radekg <[email protected]>
Test added. |
Signed-off-by: radekg <[email protected]>
.travis.yml
Outdated
if: branch = master AND type IN (push) | ||
dist: bionic | ||
go: 1.12.x | ||
script: ./scripts/travis/fuzzit.sh fuzzing |
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.
These changes don't belong to this PR. Please sync with master
Signed-off-by: radekg <[email protected]>
Signed-off-by: radekg <[email protected]>
ping |
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. @yurishkuro, were all your concerns addressed?
I'm merging this, as I don't think there's any remaining concern. |
Nice, thank you @jpkrohling. |
Which problem is this PR solving?
This PR implements the collector Jaeger tags: Resolves #1844.
Short description of the changes
Adds support for collector
--jaeger.tags
attribute. Reuses Jaeger tags handling code from the agent.