-
Notifications
You must be signed in to change notification settings - Fork 651
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
Update protobuf dependency to 4.x #2880
Comments
This is a major breaking change afaik as old protobuf library version won't be able to use newer generated protobuf code, and it would force user to upgrade newer protobuf version, which can lead extra work in other people's code base. As protobuf is used by many other libraries too. Upgrade with a major change may not be feasible at this point That said, there is indeed a workaround so that the generated code supports both protobuf>=4.21 and <=3.20 as shown below from google.protobuf.internal.api_implementation import Type
if Type() == "upb": # or int(google.protobuf.__version__.split(".")[0]) >=4
# generated code by protoc >= 3.21
else:
# generated code by protoc <= 3.20 This requires extra post-process of generated code though, and it is bit hacky. |
+1 Im currently working on a project that is using a newer protobuf (we cant downgrade) but im unable to use the opentelemetry libraries due to this issue. |
+1 This is super annoying and preventing us from moving forward with a project which needs |
I have created a work around for this #2954 |
I'm not really familiar with either protobuf or the open telemetry libraries, but it seems like Google themselves has started moving their libraries over to use protobuf 4. At least this is currently blocking us from updating a few of Google's python libraries to the newest version. So one way or another it would be great to have protobuf 4 support, and I assume most users will hit this at some point if they user other libraries that use protobuf 4 |
The latest version of |
@gen-xu : From the original report, it seems like the correct thing to do is just regenerate the protobuf files using protobuf 3.19, and they should be forward and backwards compatible with both 3.x and 4.x versions. Then we shouldn't need to switch between them at all. |
Hello, I have regenerated the code with protobuf 3.20.3 (also updated to use proto v0.19.0) at #3040. @gen-xu @markfickett @jblakeney @psigen @Alphasite @ljodal @Raz-Hemo can you please try this one and let me know if it works for you? Thanks! |
Thanks @ocelotl ! I'm still getting a pip dependency conflict between I have recently found
|
+1 this would be a major benefit for Jina https://github.com/jina-ai/jina |
@ocelotl : I think you want to generate the protos using 3.19 (keeping that version locked in requirements.txt), and then relax the runtime version dependency to include The key thing is that the library version in Here is the line that should be expanded to allow protobuf 4.x:
|
Hey folks, I'm taking over #3040 to try to get this fixed ASAP for the next release. I'd like to get a read of the room so we can decide if/when to drop protobuf 3 support. Please vote:
If 👀, please share how long you would like to see both supported. |
I work on a library that optionally integrates opentelemetry. My library also has other users that use Pulumi which requires 4.x, but other may-never-go-to-4.x libraries such as ONNX and I just merged a PR to support both where I basically gen code w/ 3.x but run CI tests w/ both. I am afraid it's the only practical way forward for libraries that are expected to be used along side other libraries that use proto. I think you have to support both until you can't. |
I’m the maintainer of the Updating to the current I can apply a PR as a downstream patch, or perhaps re-generate the bindings with Protobuf 4 myself, but things will be a lot easier if there is Protobuf 4 support in an official opentelemetry release. In conclusion, I’m firmly in the 🚀 camp. |
#3070 keeps compatibility with Protobuf 3 and 4. I'll open an issue for considering dropping protobuf 3 but we'll support both for now. |
Is your feature request related to a problem?
As other libraries upgrade to protobuf major version 4, it introduces a dependency conflict with opentelemetry still pinned to 3. In my case, I need to upgrade pulumi to 3.38.0 which uses protobuf 4, and that conflicts with OTel.
Describe the solution you'd like
It would be great if everyone can use the same major version of protobuf, upgrading to 4.
Describe alternatives you've considered
For my case, I tried running
pulumi
usingpipx
, but although that keeps its executable dependencies separate, it still needs to import parts of my application code in my virtual environment, so there's a conflict. I'm using infrastructure as code relating to monitoring dashboards and alerts, so the IaC is somewhat tightly coupled with my OTel code; I couldn't split them into separate projects with distinct dependencies.Even though I can override the proto version in my virtual env, if I lock protobuf 4 in my requirements.txt then I can't install a fresh dev environment without errors (as is required for CircleCI, as well as new developers).
Additional context
OTel originally had not pinned protobuf 3, but the first release of protobuf 4.21.0 caused issues. As a result, OTel specifies
protobuf~=3.13.0
in a few modules.However, protobuf is now at 4.21.5 and if I install that version locally I am able to use OTel with the GRPC OLTP exporter.
The text was updated successfully, but these errors were encountered: