Skip to content

[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

Merged
merged 2 commits into from
Dec 27, 2024

Conversation

mahadzaryab1
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 commented Dec 27, 2024

Which problem is this PR solving?

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

Copy link

codecov bot commented Dec 27, 2024

Codecov Report

Attention: Patch coverage is 90.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.24%. Comparing base (8e8f72e) to head (f48b5e9).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
cmd/query/app/querysvc/query_service.go 0.00% 2 Missing ⚠️
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     
Flag Coverage Δ
badger_v1 10.57% <0.00%> (+0.01%) ⬆️
badger_v2 3.03% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v1-manual 16.46% <0.00%> (+0.02%) ⬆️
cassandra-4.x-v2-auto 2.97% <0.00%> (+<0.01%) ⬆️
cassandra-4.x-v2-manual 2.97% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-v1-manual 16.46% <0.00%> (+0.02%) ⬆️
cassandra-5.x-v2-auto 2.97% <0.00%> (+<0.01%) ⬆️
cassandra-5.x-v2-manual 2.97% <0.00%> (+<0.01%) ⬆️
elasticsearch-6.x-v1 20.20% <0.00%> (+0.03%) ⬆️
elasticsearch-7.x-v1 20.27% <0.00%> (+0.03%) ⬆️
elasticsearch-8.x-v1 20.44% <0.00%> (+0.04%) ⬆️
elasticsearch-8.x-v2 3.06% <0.00%> (-0.13%) ⬇️
grpc_v1 12.23% <0.00%> (+0.02%) ⬆️
grpc_v2 9.32% <0.00%> (+0.01%) ⬆️
kafka-2.x-v1 ?
kafka-2.x-v2 ?
kafka-3.x-v1 10.40% <0.00%> (+0.01%) ⬆️
kafka-3.x-v2 3.06% <0.00%> (+<0.01%) ⬆️
memory_v2 3.06% <0.00%> (+<0.01%) ⬆️
opensearch-1.x-v1 20.32% <0.00%> (+0.04%) ⬆️
opensearch-2.x-v1 20.32% <0.00%> (+0.04%) ⬆️
opensearch-2.x-v2 3.06% <0.00%> (+0.01%) ⬆️
tailsampling-processor 0.56% <0.00%> (+<0.01%) ⬆️
unittests 95.10% <90.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

type Adjuster interface {
Adjust(trace *model.Trace) (*model.Trace, error)
Adjust(trace *model.Trace) *model.Trace
Copy link
Member

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.

Copy link
Collaborator Author

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

@mahadzaryab1 mahadzaryab1 changed the title [v1][adjuster] Remove error from v1 adjuster interface [v1][adjuster] Change v1 adjuster interface to not return error and modify trace in place Dec 27, 2024
@yurishkuro yurishkuro merged commit e6caacb into jaegertracing:main Dec 27, 2024
53 of 54 checks passed
Manik2708 pushed a commit to Manik2708/jaeger that referenced this pull request Jan 5, 2025
…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]>
@mahadzaryab1 mahadzaryab1 deleted the fix-adjuster-interface branch January 6, 2025 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants