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

[WIP][jaeger-v2][storage] Implement read path for v2 storage interface #6170

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

mahadzaryab1
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 commented Nov 6, 2024

Which problem is this PR solving?

Description of the changes

  • Implemented the read path for the v2 storage interface. This path currently just wraps a v1 span reader and exposes a static method to access the v1 reader.
  • Change the jaeger query extension to initialize a v2 storage factory and obtain the v1 span reader from it.
  • This will unblock the development of more efficient v2 storage implementations, like ClickHouse.

How was this change tested?

  • Added unit tests for new functionality

Checklist

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 92.10526% with 3 lines in your changes missing coverage. Please review.

Project coverage is 96.45%. Comparing base (0a24f6d) to head (377d27f).
Report is 21 commits behind head on main.

Files with missing lines Patch % Lines
...md/jaeger/internal/extension/jaegerquery/server.go 76.92% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6170      +/-   ##
==========================================
- Coverage   96.47%   96.45%   -0.03%     
==========================================
  Files         354      355       +1     
  Lines       20126    20159      +33     
==========================================
+ Hits        19417    19444      +27     
- Misses        524      528       +4     
- Partials      185      187       +2     
Flag Coverage Δ
badger_v1 8.31% <ø> (ø)
badger_v2 1.67% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1 14.39% <ø> (ø)
cassandra-4.x-v2 1.61% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1 14.39% <ø> (ø)
cassandra-5.x-v2 1.61% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 18.60% <ø> (ø)
elasticsearch-7.x-v1 18.67% <ø> (-0.01%) ⬇️
elasticsearch-8.x-v1 18.85% <ø> (ø)
elasticsearch-8.x-v2 1.67% <0.00%> (-0.01%) ⬇️
grpc_v1 9.48% <ø> (ø)
grpc_v2 6.99% <0.00%> (-0.01%) ⬇️
kafka-v1 8.88% <ø> (ø)
kafka-v2 1.67% <0.00%> (-0.01%) ⬇️
memory_v2 1.67% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 18.73% <ø> (ø)
opensearch-2.x-v1 18.72% <ø> (-0.01%) ⬇️
opensearch-2.x-v2 1.67% <0.00%> (-0.01%) ⬇️
tailsampling-processor 0.46% <0.00%> (-0.01%) ⬇️
unittests 95.36% <92.10%> (-0.03%) ⬇️

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.

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 added changelog:bugfix-or-minor-feature changelog:new-feature Change that should be called out as new feature in CHANGELOG and removed changelog:bugfix-or-minor-feature labels Nov 7, 2024
@mahadzaryab1 mahadzaryab1 marked this pull request as ready for review November 7, 2024 01:22
@mahadzaryab1 mahadzaryab1 requested a review from a team as a code owner November 7, 2024 01:22
@@ -17,4 +18,7 @@ type Factory interface {

// CreateTraceWriter creates a spanstore.Writer.
CreateTraceWriter() (Writer, error)

// CreateDependencyReader creates a dependencystore.Reader.
CreateDependencyReader() (dependencystore.Reader, error)
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 not sure if this belongs here since we're in package spanstore - let me know if you have any thoughts on how we should proceed here

Copy link
Member

Choose a reason for hiding this comment

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

I think it needs to be a different interface

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 Do we want to add an interface like https://github.com/jaegertracing/jaeger/blob/main/storage/dependencystore/interface.go#L1-L22 in storage_v2 to operate on OTLP data and use the same trick to extract the v1 reader?

Copy link
Member

Choose a reason for hiding this comment

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

no, I think we should keep that same interface for now. Dependencies are not part of OTLP, so we always need our own model, which we have in v1 interface, so I don't see a strong reason to create v2 of it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sounds good! i changed the storage extension to initialize v1 and v2 factories

return fmt.Errorf("cannot create trace reader: %w", err)
}

spanReader, err := factoryadapter.GetV1Reader(traceReader)
Copy link
Member

Choose a reason for hiding this comment

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

the idea was to push this conversion down into query service (as deep as possible), otherwise we can never make it work with v2 API

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 Oh okay I see. So a couple of follow-ups

Copy link
Member

Choose a reason for hiding this comment

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

Do we want to take the traceReader as part of the constructor, hold it in the QueryService struct and then perform the conversion before calling the underlying method

yes

Do we want to use the storage v2 factory in v1 context as well?

Not quite following, what do you mean by context?

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 marked this pull request as draft November 10, 2024 20:17
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage changelog:new-feature Change that should be called out as new feature in CHANGELOG v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants