-
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
Migrate proto-gen/thrift-gen to jaeger-idl #6494
Comments
I'll give this issue a try, though it looks a bit challenging for me. However, if someone else wants to work on it, feel free to take it |
working on it !
currently working on this |
Seems like it is taking some time. Also trying this issue. |
## Which problem is this PR solving? - Part 1 and 2 of jaegertracing/jaeger#6494 for api_v2 ## Description of the changes - Create makefile for compiling and generating code from .proto files present - All locations of proto files, as well as generated code are inspired from main jaeger repo. (Since no other alteranative was suggested in issue.) - Add all the generated code from the proto files as well. - Create ci-lint file for same. ## How was this change tested? - CI ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] 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: adityachopra29 <[email protected]>
## Which problem is this PR solving? - Part of jaegertracing/jaeger#6494 ## Description of the changes - Add code gen for `model.proto` into `model/v1` package - 🛑 breaking change: query.proto changed references to custom types to local TraceID/SpanID instead of importing the main `jaeger` repo - Copy minimal set of types from original `model/` that are required by api_v2, such as TraceID, SpanID, and `Flags` required by `model` - Add `go.mod` to make it into importable library - Add basic `go test` to CI ## How was this change tested? - `go test ./model/v1` ## Checklist - [ ] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [ ] I have signed all commits - [ ] I have added unit tests for the new functionality - [ ] 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: Yuri Shkuro <[email protected]>
## Which problem is this PR solving? - Part of #6494 ## Description of the changes - Bump jaeger-idl submodule - Adjust code gen to account for different custom types due to jaegertracing/jaeger-idl#118 ## How was this change tested? - CI Signed-off-by: Yuri Shkuro <[email protected]>
## Which problem is this PR solving? - Part of jaegertracing#6494 ## Description of the changes - Bump jaeger-idl submodule - Adjust code gen to account for different custom types due to jaegertracing/jaeger-idl#118 ## How was this change tested? - CI Signed-off-by: Yuri Shkuro <[email protected]>
## Which problem is this PR solving? - Part of #6494 ## Description of the changes - If we move TraceID/SpanID types to jaeger-idl we will not be able to define methods on them, so change to plain functions. ## How was this change tested? - CI Signed-off-by: Yuri Shkuro <[email protected]>
## Which problem is this PR solving? - Part of #6494 - Since `jaeger-idl` repo now includes Go code, as soon as we update the submodule here it's treated as a real source of Go code, including by tools like `go fmt`, etc. ## Description of the changes - Exclude `idl/` from ALL_SOURCES, so that `make fmt` does not apply to it - Bump `idl` submodule to latest ## How was this change tested? - CI Signed-off-by: Yuri Shkuro <[email protected]>
hello @yurishkuro i was trying to update the main Jaeger repo to use models from jaeger-idl my approach suggestion is that I can divide it on multiple 2 prs so it can be easy to review and migrate first I think we can start by
then
if you think I'm good to go I can start |
@Nabil-Salah I think you have to start with jaeger repo. Because OTEL imports some of the Jaeger code directly, and that code beings the jaeger/model dependencies, while some other code in OTEL might be using jaeger/model dependencies directly. For example, OTEL depends on code from jaeger/cmd/agent, which is using jaeger/model. Some modules in OTEL might be upgraded independently, but then you may run into a different issue where the same GRPC type is registered twice, and it will not work. Other OTEL modules would definitely not work if you try to upgrade them first. Having said that, the same, in theory, could happen if we try to upgrade Jaeger first. But I would start there and see what issues we get into. In the worse case we may have to resort to blanket copying of code (temporarily) to break circular dependency, in particular model<>otlp translation from OTEL. TLDR - need to try it. |
okay will take some investigation time and till you what errors encountered or blocking states I reach |
@Nabil-Salah I already added dependency on jaeger-idl to the main repo. The change you should make is search/replace the imports of jaeger/model and api_v2 with the equivalent paths from jaeger-idl. And then just see what compiles / builds / CI. |
I tried multiple of things but it always end up with a domino effect
the two block states are the same these two files use OTEL what I suggest is that I implement a function that will translate jaeger model it will a cumbersome function but it will be a temporary work until OTEL change also
|
I don't think this is a good approach. It is inefficient and still keeps the internal dependency on the |
this can be a standalone PR, will not affect anything. Put it into |
okay this looks really good idea |
) ## Which problem is this PR solving? - part of #6595 - part of #6494 ## Description of the changes - change models ## How was this change tested? - `make lint`, `make test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] 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: nabil salah <[email protected]>
## Which problem is this PR solving? - Part of #6494 ## Description of the changes - Move OTEL-IDs helpers to v1adapter - Clean-up model aliases - Remove unnecessary test in model (it exists in idl/model/v1) - Prohibit dependencies on `github.com/jaegertracing/jaeger/model` via linter - Fix `storage.proto` code-gen to not rely on `model/` ## How was this change tested? - CI --------- Signed-off-by: Yuri Shkuro <[email protected]>
## Which problem is this PR solving? - part of #6494 ## Description of the changes - replace model proto-gen_api_v2 imports to use jaeger-idl proto-gen/api_v2 imports - Prohibit dependencies on github.com/jaegertracing/jaeger/proto-gen/api_v2 via linter ## How was this change tested? - `make test` ## Checklist - [x] I have read https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md - [x] I have signed all commits - [ ] 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: nabil salah <[email protected]>
In #6408 it was proposed that we break up the circular dependency between Jaeger and OTEL code bases by cloning some of the code from Jaeger to OTEL, in particular the auto-generated classes for Proto and Thrift.
However, it turns out Proto does not work if the same Protobuf type is registered more than once, because Proto uses a global registry. For example, when I used
model.proto
to generate the output into a different folderproto-gen/model/
(compared to our standardmodel/
) in #6493, then the unit test that tries to use both models failsAs a result, a number of sub-tasks proposed in #6408 will not work if both OTEL and Jaeger have proto-generated types for the same .proto interfaces. This is likely the same issue as reported in open-telemetry/opentelemetry-go-contrib#6555.
One possible workaround is to tweak the IDL files to use a different namespace for the Proto types, e.g. instead of
jaeger.api_v2.ValueType
the OTEL could useotel.jaeger.api_v2.ValueType
. This only works if the generated structs are used to marshal binary payloads like[]byte
where the namespace of the type does not matter. But if an actual Proto service is implemented then I don't think it can use a different namespace, since then the clients won't be able to use that service.Since it does not seem like we'd be able to easily avoid OTEL code using some of the Jaeger proto structs, the proposal is to move them out of Jaeger repository. We already include jaeger-idl as a submodule and read the proto files from there to generate code. Instead, we can use jaeger-idl as a regular Go dependency and generate the code in that repository (we already do that today as part of IDL repo CI, but we don't persist that code).
Tasks:
The text was updated successfully, but these errors were encountered: