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

Open
wants to merge 11 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

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

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

Project coverage is 96.23%. Comparing base (0a24f6d) to head (e3a8487).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
.../extension/jaegerstorage/factoryadapter/factory.go 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6170      +/-   ##
==========================================
- Coverage   96.47%   96.23%   -0.25%     
==========================================
  Files         354      355       +1     
  Lines       20126    20156      +30     
==========================================
- Hits        19417    19397      -20     
- Misses        524      575      +51     
+ Partials      185      184       -1     
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 ?
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.84% <ø> (-0.01%) ⬇️
elasticsearch-8.x-v2 1.67% <0.00%> (-0.01%) ⬇️
grpc_v1 9.48% <ø> (ø)
grpc_v2 6.98% <0.00%> (-0.01%) ⬇️
kafka-v1 ?
kafka-v2 1.67% <0.00%> (-0.01%) ⬇️
memory_v2 1.66% <0.00%> (-0.02%) ⬇️
opensearch-1.x-v1 18.73% <ø> (ø)
opensearch-2.x-v1 18.73% <ø> (ø)
opensearch-2.x-v2 1.66% <0.00%> (-0.02%) ⬇️
tailsampling-processor 0.46% <0.00%> (-0.01%) ⬇️
unittests 95.37% <94.11%> (-0.02%) ⬇️

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.

@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?

Comment on lines 24 to 28
tr, ok := reader.(*TraceReader)
if !ok {
return nil, ErrV1ReaderNotAvailable
}
return tr.spanReader, nil
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tr, ok := reader.(*TraceReader)
if !ok {
return nil, ErrV1ReaderNotAvailable
}
return tr.spanReader, nil
if tr, ok := reader.(*TraceReader); ok {
return tr.spanReader, nil
}
return nil, ErrV1ReaderNotAvailable

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

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