-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[refactor] Converge v2 API with v2 remote storage API #6784
Conversation
Signed-off-by: Mahad Zaryab <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @mahadzaryab1, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
Summary of Changes
This pull request focuses on converging the v2 storage API with the v2 remote storage API. This involves renaming several parameters and types to align with the naming conventions used in the v2 remote storage API. Specifically, NumTraces
is renamed to SearchDepth
, TraceQueryParams
to TraceQueryParameters
, GetTraceParams
to GetTraceParameters
, and OperationQueryParams
to OperationQueryParameters
. The changes are spread across multiple files in the cmd/jaeger
, cmd/query
, and internal/storage
directories, ensuring consistency between the two APIs.
Highlights
- API Convergence: The primary goal is to converge the v2 storage API with the v2 remote storage API to ensure consistency.
- Parameter Renaming: Key parameters and types are renamed to align with the v2 remote storage API naming conventions.
- Code Refactoring: The codebase is refactored to use the new parameter and type names, ensuring that all references are updated.
Changelog
Click here to see the changelog
- cmd/jaeger/internal/exporters/storageexporter/exporter_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in the test case.
- Renamed
- cmd/jaeger/internal/integration/trace_reader.go
- Renamed
GetTraceParams
toGetTraceParameters
in theGetTraces
function signature. - Renamed
OperationQueryParams
toOperationQueryParameters
in theGetOperations
function signature. - Renamed
TraceQueryParams
toTraceQueryParameters
in theFindTraces
function signature. - Renamed
NumTraces
toSearchDepth
within theFindTraces
function. - Renamed
TraceQueryParams
toTraceQueryParameters
in theFindTraceIDs
function signature.
- Renamed
- cmd/query/app/apiv3/gateway_test.go
- Renamed
OperationQueryParams
toOperationQueryParameters
inrunGatewayGetOperations
. - Renamed
GetTraceParams
toGetTraceParameters
inrunGatewayGetTrace
.
- Renamed
- cmd/query/app/apiv3/grpc_handler.go
- Renamed
GetTraceParams
toGetTraceParameters
in theGetTrace
function. - Renamed
TraceQueryParams
toTraceQueryParameters
andNumTraces
toSearchDepth
in theinternalFindTraces
function. - Renamed
OperationQueryParams
toOperationQueryParameters
in theGetOperations
function.
- Renamed
- cmd/query/app/apiv3/grpc_handler_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in theTestGetTrace
test cases. - Renamed
GetTraceParams
toGetTraceParameters
in theTestGetTraceStorageError
test.
- Renamed
- cmd/query/app/apiv3/http_gateway.go
- Renamed
GetTraceParams
toGetTraceParameters
in thegetTrace
function. - Renamed
TraceQueryParams
toTraceQueryParameters
andNumTraces
toSearchDepth
in theparseFindTracesQuery
function. - Renamed
OperationQueryParams
toOperationQueryParameters
in thegetOperations
function.
- Renamed
- cmd/query/app/apiv3/http_gateway_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in theTestHTTPGatewayGetTrace
test cases. - Renamed
TraceQueryParams
toTraceQueryParameters
andNumTraces
toSearchDepth
in themockFindQueries
function. - Renamed
OperationQueryParams
toOperationQueryParameters
in theTestHTTPGatewayGetOperationsErrors
test.
- Renamed
- cmd/query/app/querysvc/v2/querysvc/service.go
- Renamed
GetTraceParams
toGetTraceParameters
and updated theTraceIDs
field. - Renamed
TraceQueryParams
toTraceQueryParameters
. - Renamed
OperationQueryParams
toOperationQueryParameters
in theGetOperations
function. - Renamed
GetTraceParams
toGetTraceParameters
in theArchiveTrace
function.
- Renamed
- cmd/query/app/querysvc/v2/querysvc/service_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in theTestGetTraces_ErrorInReader
test. - Renamed
GetTraceParams
toGetTraceParameters
in theTestGetTraces_Success
test. - Renamed
GetTraceParams
toGetTraceParameters
in theTestGetTraces_WithRawTraces
test. - Renamed
GetTraceParams
toGetTraceParameters
in theTestGetTraces_TraceInArchiveStorage
test. - Renamed
OperationQueryParams
toOperationQueryParameters
in theTestGetOperations
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestFindTraces_Success
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestFindTraces_WithRawTraces_PerformsAdjustment
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestFindTraces_WithRawTraces_PerformsAggregation
test. - Renamed
GetTraceParams
toGetTraceParameters
in theTestArchiveTrace
test.
- Renamed
- internal/storage/integration/elasticsearch_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in thetestArchiveTrace
function.
- Renamed
- internal/storage/integration/integration.go
- Renamed
TraceQueryParams
toTraceQueryParameters
in theToTraceQueryParams
function. - Renamed
NumTraces
toSearchDepth
in theToTraceQueryParams
function. - Renamed
TraceQueryParams
toTraceQueryParameters
in thetestGetServices
function. - Renamed
GetTraceParams
toGetTraceParameters
in thetestGetLargeSpan
function. - Renamed
OperationQueryParams
toOperationQueryParameters
in thetestGetOperations
function. - Renamed
GetTraceParams
toGetTraceParameters
in thetestGetTrace
function. - Renamed
GetTraceParams
toGetTraceParameters
in thetestGetTrace
function'sNotFound error
subtest. - Renamed
TraceQueryParams
toTraceQueryParameters
in thefindTracesByQuery
function.
- Renamed
- internal/storage/v2/api/tracestore/mocks/Reader.go
- Renamed
TraceQueryParams
toTraceQueryParameters
in theFindTraceIDs
mock function. - Renamed
TraceQueryParams
toTraceQueryParameters
in theFindTraces
mock function. - Renamed
OperationQueryParams
toOperationQueryParameters
in theGetOperations
mock function. - Renamed
GetTraceParams
toGetTraceParameters
in theGetTraces
mock function.
- Renamed
- internal/storage/v2/api/tracestore/reader.go
- Renamed
GetTraceParams
toGetTraceParameters
in theReader
interface. - Renamed
OperationQueryParams
toOperationQueryParameters
in theReader
interface. - Renamed
TraceQueryParams
toTraceQueryParameters
in theReader
interface. - Renamed
GetTraceParams
toGetTraceParameters
and updated its description. - Renamed
TraceQueryParams
toTraceQueryParameters
and updated its description. - Renamed
OperationQueryParams
toOperationQueryParameters
and updated its description. - Renamed
TraceQueryParams
toTraceQueryParameters
in theToSpanStoreQueryParameters
function. - Renamed
NumTraces
toSearchDepth
in theToSpanStoreQueryParameters
function.
- Renamed
- internal/storage/v2/grpc/trace_storage.proto
- Renamed
GetTraceParams
toGetTraceParameters
and updated its description. - Renamed
GetTraceParams
toGetTraceParameters
in theGetTracesRequest
message.
- Renamed
- internal/storage/v2/v1adapter/spanreader.go
- Renamed
GetTraceParams
toGetTraceParameters
in theGetTrace
function. - Renamed
OperationQueryParams
toOperationQueryParameters
in theGetOperations
function. - Renamed
TraceQueryParams
toTraceQueryParameters
andNumTraces
toSearchDepth
in theFindTraces
function. - Renamed
TraceQueryParams
toTraceQueryParameters
andNumTraces
toSearchDepth
in theFindTraceIDs
function.
- Renamed
- internal/storage/v2/v1adapter/spanreader_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in theTestSpanReader_GetTrace
test cases. - Renamed
OperationQueryParams
toOperationQueryParameters
in theTestSpanReader_GetOperations
test cases. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestSpanReader_FindTraces
test cases. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestSpanReader_FindTraceIDs
test cases.
- Renamed
- internal/storage/v2/v1adapter/tracereader.go
- Renamed
GetTraceParams
toGetTraceParameters
in theGetTraces
function. - Renamed
OperationQueryParams
toOperationQueryParameters
in theGetOperations
function. - Renamed
TraceQueryParams
toTraceQueryParameters
in theFindTraces
function. - Renamed
TraceQueryParams
toTraceQueryParameters
in theFindTraceIDs
function.
- Renamed
- internal/storage/v2/v1adapter/tracereader_test.go
- Renamed
GetTraceParams
toGetTraceParameters
in theTestTraceReader_GetTracesDelegatesSuccessResponse
test. - Renamed
GetTraceParams
toGetTraceParameters
in theTestTraceReader_GetTracesErrorResponse
test. - Renamed
GetTraceParams
toGetTraceParameters
in theTestTraceReader_GetTracesEarlyStop
test. - Renamed
OperationQueryParams
toOperationQueryParameters
in theTestTraceReader_GetOperationsDelegatesResponse
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestTraceReader_FindTracesDelegatesSuccessResponse
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestTraceReader_FindTracesEdgeCases
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestTraceReader_FindTracesEarlyStop
test. - Renamed
TraceQueryParams
toTraceQueryParameters
in theTestTraceReader_FindTraceIDsDelegatesResponse
test.
- Renamed
- proto-gen/storage/v2/trace_storage.pb.go
- Renamed
GetTraceParams
toGetTraceParameters
and updated its description. - Renamed
GetTraceParams
toGetTraceParameters
in theGetTracesRequest
message.
- Renamed
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Trivia time!
What is the purpose of Protocol Buffers (protobuf) used for defining the gRPC API?
Click here for the answer
Protocol Buffers (protobuf) are a language-neutral, platform-neutral extensible mechanism for serializing structured data. They are used to define the structure of data exchanged between services in gRPC, ensuring efficient and reliable communication.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request focuses on converging the v2 storage API with the v2 remote storage API by renaming several parameters and types. The changes seem straightforward and well-tested, as indicated by the CI passing and the inclusion of unit tests. The renaming aligns the codebase with the new API, improving consistency.
Summary of Findings
Merge Readiness
The changes in this pull request appear to be well-implemented and tested. The renaming of parameters and types contributes to a more consistent and understandable API. I am unable to directly approve this pull request, and recommend that others review and approve this code before merging. Given the nature of the changes and the included tests, the pull request seems ready for merging, assuming that the changes do not break any dependent code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Overview
This PR refactors the v2 storage API to converge its naming conventions with the v2 remote storage API. Key changes include renaming types and parameters such as:
- "GetTraceParams" to "GetTraceParameters"
- "TraceQueryParams" to "TraceQueryParameters"
- "OperationQueryParams" to "OperationQueryParameters"
- Replacing the "NumTraces" field with "SearchDepth" in related structs
Reviewed Changes
File | Description |
---|---|
internal/storage/v2/api/tracestore/reader.go | Renamed types and updated field "NumTraces" to "SearchDepth" in the trace query parameters and mappings |
cmd/query/app/apiv3/http_gateway_test.go | Updated test expectations to use the new parameter type names |
internal/storage/v2/v1adapter/tracereader_test.go | Updated tests to reflect the new type names and field renaming |
proto-gen/storage/v2/trace_storage.pb.go | Adjusted generated types and registration for the renamed proto messages |
... | Other files (mocks, integration tests, handler tests, etc.) have been updated consistently |
Copilot reviewed 20 out of 20 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
internal/storage/v2/api/tracestore/reader.go:116
- [nitpick] The conversion in ToSpanStoreQueryParameters maps 'SearchDepth' to the target field 'NumTraces'. This naming difference can be confusing; consider adding a comment to clarify why the field is named differently in the destination struct or evaluate aligning the field names for consistency.
NumTraces: t.SearchDepth,
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6784 +/- ##
==========================================
+ Coverage 96.02% 96.03% +0.01%
==========================================
Files 364 364
Lines 20690 20690
==========================================
+ Hits 19867 19870 +3
+ Misses 628 626 -2
+ Partials 195 194 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Mahad Zaryab <[email protected]>
2741249
to
8438b69
Compare
Which problem is this PR solving?
Description of the changes
NumTraces
->SearchDepth
TraceQueryParams
How was this change tested?
Checklist
jaeger
:make lint test
jaeger-ui
:npm run lint
andnpm run test