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

[ES] Refactored a part of SpanReader to make it reusable for V2 APIs #6824

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

Manik2708
Copy link
Contributor

Which problem is this PR solving?

Fixes a part of: #6458

Description of the changes

  • Refactored a part of SpanReader to make it reusable for V2 APIs

How was this change tested?

  • Unit Tests

Checklist

@Manik2708 Manik2708 requested a review from a team as a code owner March 6, 2025 22:05
@Manik2708 Manik2708 requested a review from jkowall March 6, 2025 22:05
@@ -591,7 +645,7 @@ func (s *SpanReader) findTraceIDs(ctx context.Context, traceQuery *spanstore.Tra
searchResult, err := searchService.Do(ctx)
if err != nil {
err = es.DetailedError(err)
s.logger.Info("es search services failed", zap.Any("traceQuery", traceQuery), zap.Error(err))
s.logger.Info("es search services failed", zap.Any("traceQuery", serviceName), zap.Error(err))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Where should I log this? Query can't be accessed by this method as it is to be used in V2 also!

Copy link

codecov bot commented Mar 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.07%. Comparing base (147a72b) to head (4737b3c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6824      +/-   ##
==========================================
+ Coverage   96.05%   96.07%   +0.02%     
==========================================
  Files         364      364              
  Lines       20712    20742      +30     
==========================================
+ Hits        19894    19927      +33     
+ Misses        624      622       -2     
+ Partials      194      193       -1     
Flag Coverage Δ
badger_v1 9.83% <0.00%> (-0.03%) ⬇️
badger_v2 1.98% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v1-manual 14.83% <0.00%> (-0.05%) ⬇️
cassandra-4.x-v2-auto 1.97% <0.00%> (-0.01%) ⬇️
cassandra-4.x-v2-manual 1.97% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v1-manual 14.83% <0.00%> (-0.05%) ⬇️
cassandra-5.x-v2-auto 1.97% <0.00%> (-0.01%) ⬇️
cassandra-5.x-v2-manual 1.97% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x-v1 19.47% <93.75%> (+0.21%) ⬆️
elasticsearch-7.x-v1 19.55% <93.75%> (+0.21%) ⬆️
elasticsearch-8.x-v1 19.72% <93.75%> (+0.20%) ⬆️
elasticsearch-8.x-v2 1.98% <0.00%> (-0.01%) ⬇️
grpc_v1 10.87% <0.00%> (-0.04%) ⬇️
grpc_v2 7.92% <0.00%> (-0.03%) ⬇️
kafka-3.x-v1 10.12% <0.00%> (-0.04%) ⬇️
kafka-3.x-v2 1.98% <0.00%> (-0.01%) ⬇️
memory_v2 1.98% <0.00%> (-0.01%) ⬇️
opensearch-1.x-v1 19.60% <93.75%> (+0.21%) ⬆️
opensearch-2.x-v1 19.60% <93.75%> (+0.21%) ⬆️
opensearch-2.x-v2 1.98% <0.00%> (-0.01%) ⬇️
tailsampling-processor 0.48% <0.00%> (-0.01%) ⬇️
unittests 94.96% <100.00%> (+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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Manik2708
Copy link
Contributor Author

Manik2708 commented Mar 6, 2025

@mahadzaryab1 @yurishkuro This PR tries to make GetOperations, GetServices and FindTraceIDs of SpanReader ready for V2. But GetTraces, FindTraces can't be fixed because for that we need to make multiread either independent of TraceId or make it generic. First option is not feasible as TraceId is not there in dbmodel. Therefore I suggest usage of generics, like this way:

func [T model.TraceId | otel.TraceId] multiread(traceIds T[], ...other_parameters) dbmodel.Span[] {} 

Or we have to re-implement the multiread method by making some query methods as public (which will be used in the new multiread)
If the generic approach seems fine, then I would raise another PR to implement this seperately!

@yurishkuro
Copy link
Member

yurishkuro commented Mar 6, 2025

@Manik2708 the DB layer treats IDs as strings, so the underlying reader can accept them as strings and make it the responsibility of v1/v2 readers to do a conversion

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