-
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
opentelemetry-exporter-otlp-proto-grpc breaks with protobuf 4.21.0 #2717
Comments
We could just change install_requires to |
I ran some local tests and pinning to the previous major version of protobuf actually fixes it. Here's the list of breaking changes in the 4.x protobuf release (taken from here):
|
Yeah, explicitly depending on Long-term, regenerating the code with "protoc 3.19.0 or newer" needs to happen, and in fact (per the protobuf Python install docs) there seems to be an expectation that when using protobuf version X, the generated code should be generated with protoc of the same version. So perhaps the protobuf version should always have been pinned to the protoc version used to generate the code, and conversely, regeneration done more often to shift the pin? |
For the record, https://github.com/open-telemetry/opentelemetry-python-contrib/blob/main/instrumentation/opentelemetry-instrumentation-grpc/setup.cfg#L53 (in the |
I posted #2720 to fix this in the easy (and backportable) way, but in the meantime, the |
Thanks for jumping on this @TBBle!
I don't think this is feasible, if someone has multiple libraries with generated code which don't use the same protobuf version, they will hit dependency conflicts, e.g. a google cloud client libraries and opentelemetry-proto.
I think that is a fair assumption, see protocolbuffers/protobuf#10051 (comment) |
Yup, that makes sense, since Python package managers resolve dependencies across a project, not per-project, there needs to be a commonly-compatible Given that there's clearly a wide-spread habit of I see protobuf 4.21.0 has been unyanked again, and there's still some activity on that ticket, e.g.
which suggests that even if not-feasible, at least some committer on that project had the same expectation as I think the docs implied (and also a workflow in mind that I don't think I've actually seen in the various protobuf-using projects I've touched in Python or Go). |
If I understand correctly if you regenerate OTEL code using protobuf version 3.19 it will be working with both 3.x proto and 4.x proto. And 3.19 does not have breaking changes with 3.13, so it should work with previously installed setups. Maybe it will be a good solution for now? Protobuf 4.x offers significantly better parsing performance and it will be sad if I cannot use it with OTEL in my project. |
Yes, regenerating with modern protoc and changing the dependency to The reasons I didn't do it in my PR:
|
opentelemetry-exporter-otlp-proto-grpc
is broken on its latest stable release (v1.11.1). This is due to the breaking changes contained in the latest release of protobuf. You can find more details about the breaking changes here: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updatesDescribe your environment
Steps to reproduce
What is the expected behavior?
The OTLPSpanExporter is imported correctly.
What is the actual behavior?
This exception is thrown:
Additional context
More context about the issue and the latest protobuf release can be found here:
https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates
The text was updated successfully, but these errors were encountered: