-
Notifications
You must be signed in to change notification settings - Fork 2.6k
[v1][adjuster] Change v1 adjuster interface to not return error and modify trace in place #6426
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
[v1][adjuster] Change v1 adjuster interface to not return error and modify trace in place #6426
Conversation
Signed-off-by: Mahad Zaryab <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6426 +/- ##
==========================================
- Coverage 96.27% 96.24% -0.03%
==========================================
Files 368 368
Lines 21008 20977 -31
==========================================
- Hits 20225 20189 -36
- Misses 599 603 +4
- Partials 184 185 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
model/adjuster/adjuster.go
Outdated
type Adjuster interface { | ||
Adjust(trace *model.Trace) (*model.Trace, error) | ||
Adjust(trace *model.Trace) *model.Trace |
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.
Any reason to return the trace? I don't think any adjusters actually create a new one, they always return the original trace that may be changed in place. So I would make it consistent with the v2 Adapter API to simplify things.
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.
@yurishkuro was thinking the same thing as well - done
Signed-off-by: Mahad Zaryab <[email protected]>
…odify trace in place (jaegertracing#6426) ## Which problem is this PR solving? - Towards jaegertracing#6417 ## Description of the changes - The v1 adjuster interface returns an error even though none of the adjusters ever return an error. This was leading to handling errors that would never be thrown. This PR simplifies the interface by removing the error return. - The v1 adjuster interface was also returning the trace that it modified. However, all the adjusters currently just take the trace in as a pointer and modify it in place so this return was not necessary. ## How was this change tested? - CI ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [x] I have added unit tests for the new functionality - [x] I have run lint and test steps successfully - for `jaeger`: `make lint test` - for `jaeger-ui`: `npm run lint` and `npm run test` --------- Signed-off-by: Mahad Zaryab <[email protected]>
Which problem is this PR solving?
Description of the changes
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test