Skip to content
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

[v2][storage] Implement reverse adapter to translate v2 storage api to v1 #6485

Merged
merged 14 commits into from
Jan 5, 2025

Conversation

mahadzaryab1
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 commented Jan 5, 2025

Which problem is this PR solving?

Description of the changes

  • This PR implements a reverse adapter (SpanReader) that wraps a native v2 storage interface (tracestore.Reader) and downgrades it to implement the v1 storage interface (spanstore.Reader).
  • The reverse adapter was integrated with the v1 query service. This code path will only get executed once we start upgrading the existing storage implementations to implement the new tracestore.Reader interface as a part of Upgrade Storage Backends to V2 Storage API #6458

How was this change tested?

  • CI
  • Added new unit tests

Checklist

Copy link

codecov bot commented Jan 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.31%. Comparing base (a44d8b1) to head (c61aa0e).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6485      +/-   ##
==========================================
+ Coverage   96.27%   96.31%   +0.03%     
==========================================
  Files         370      371       +1     
  Lines       21169    21251      +82     
==========================================
+ Hits        20380    20467      +87     
+ Misses        604      600       -4     
+ Partials      185      184       -1     
Flag Coverage Δ
badger_v1 10.67% <0.00%> (-0.09%) ⬇️
badger_v2 2.78% <0.00%> (-0.03%) ⬇️
cassandra-4.x-v1-manual 16.51% <0.00%> (-0.13%) ⬇️
cassandra-4.x-v2-auto 2.71% <0.00%> (-0.03%) ⬇️
cassandra-4.x-v2-manual 2.71% <0.00%> (-0.03%) ⬇️
cassandra-5.x-v1-manual 16.51% <0.00%> (-0.13%) ⬇️
cassandra-5.x-v2-auto 2.71% <0.00%> (-0.03%) ⬇️
cassandra-5.x-v2-manual 2.71% <0.00%> (-0.03%) ⬇️
elasticsearch-6.x-v1 20.17% <0.00%> (-0.17%) ⬇️
elasticsearch-7.x-v1 20.25% <0.00%> (-0.16%) ⬇️
elasticsearch-8.x-v1 20.41% <0.00%> (-0.16%) ⬇️
elasticsearch-8.x-v2 2.77% <0.00%> (-0.03%) ⬇️
grpc_v1 12.31% <0.00%> (-0.10%) ⬇️
grpc_v2 9.09% <0.00%> (-0.07%) ⬇️
kafka-3.x-v1 10.35% <0.00%> (-0.08%) ⬇️
kafka-3.x-v2 2.78% <0.00%> (-0.03%) ⬇️
memory_v2 2.78% <0.00%> (-0.03%) ⬇️
opensearch-1.x-v1 20.29% <0.00%> (-0.16%) ⬇️
opensearch-2.x-v1 20.30% <0.00%> (-0.15%) ⬇️
opensearch-2.x-v2 2.77% <0.00%> (-0.04%) ⬇️
tailsampling-processor 0.51% <0.00%> (-0.01%) ⬇️
unittests 95.18% <100.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.

Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Signed-off-by: Mahad Zaryab <[email protected]>
@@ -85,7 +85,7 @@ func parseResponse(t *testing.T, body []byte, obj gogoproto.Message) {
require.NoError(t, gogojsonpb.Unmarshal(bytes.NewBuffer(body), obj))
}

func makeTestTraceV2() ptrace.Traces {
func makeTestTrace() ptrace.Traces {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drive by change: i forgot to change the name of this function in a previous PR

@mahadzaryab1 mahadzaryab1 changed the title [WIP][v2][storage] Implement reverse adapter to translate v2 storage api to v1 [v2][storage] Implement reverse adapter to translate v2 storage api to v1 Jan 5, 2025
@mahadzaryab1 mahadzaryab1 marked this pull request as ready for review January 5, 2025 16:52
@mahadzaryab1 mahadzaryab1 requested a review from a team as a code owner January 5, 2025 16:52
@mahadzaryab1 mahadzaryab1 enabled auto-merge (squash) January 5, 2025 18:09
@mahadzaryab1 mahadzaryab1 merged commit 4024a24 into jaegertracing:main Jan 5, 2025
54 checks passed
@mahadzaryab1 mahadzaryab1 deleted the reverse-adapter branch January 6, 2025 00:42
adityachopra29 pushed a commit to adityachopra29/jaeger that referenced this pull request Jan 9, 2025
…o v1 (jaegertracing#6485)

## Which problem is this PR solving?
- Resolves jaegertracing#6480

## Description of the changes
- This PR implements a reverse adapter (`SpanReader`) that wraps a
native v2 storage interface (`tracestore.Reader`) and downgrades it to
implement the v1 storage interface (`spanstore.Reader`).
- The reverse adapter was integrated with the v1 query service. This
code path will only get executed once we start upgrading the existing
storage implementations to implement the new `tracestore.Reader`
interface as a part of
jaegertracing#6458

## How was this change tested?
- CI
- Added new unit tests

## 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]>
Signed-off-by: adityachopra29 <[email protected]>
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.

[query] Update v1 Query Service To Accept v2 Storage API
2 participants