-
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
feat(routingprocessor): allow routing for all signals #5869
feat(routingprocessor): allow routing for all signals #5869
Conversation
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.
Looks great! Can you improve the test coverage? There are a few places with no coverage, like most of the router.RouteTraces
. Also, there's some duplication in the router, with pretty much the same code for all signals, except for actually building the pdata. Do you think we can make it generic?
I'll take care of the coverage and the PR comments when I have a spare moment.
I was thinking about this and I couldn't come up with a proper approach to make it generic since there's no real interface overlap between the top level signal structs ( I'll try to figure out a way to make small routing related bits common to all of those but I can't promise much |
Thank you, that's more than I can ask for! |
Ok, so I thought about this and without resorting to using For instance
I could define an interface that that would a "generic for loop" i.e. something like: type Looper interface {
Len() int
At(int) pdata.ResourceSpans <- this is the problematic bit
} but then I cannot make it generic because the Same applies to other places. Resorting to Something similar applies to slices of interfaces e.g. where I return
wouldn't work because one cannot assign:
(in order to make the last bit work we'd need to loop and Anyway: I'm not saying this is impossible but it's tricky to make it pretty in this particular example. |
I've added more tests @jpkrohling, PTAL |
Thanks for investigating! Perhaps we could start an experiment in the future, post-GA, seeing how we can use Go generics to simplify the API. |
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, just a question about why you are having two data points being consumed, as I don't remember it having any influence on the code under test.
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!
@jpkrohling lint errors, please add the "ready-to-merge" label when ready for real :) |
24e4653
to
ef1b2bc
Compare
Ok, I see. The I've changed the code so that @jpkrohling PTAL. |
Description:
routingprocessor
: allow routing for all signalsLink to tracking Issue: N/A
Testing: Added relevant unit tests
Documentation: Changed README.md