opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Add support for Protobuf 5

Open aabmass opened this issue 8 months ago • 5 comments

Protobuf 5 was released but it currently conflicts with opentelemetry-proto package https://github.com/open-telemetry/opentelemetry-python/blob/762bd8f2629a1babc0eee4361a4873433511e836/opentelemetry-proto/pyproject.toml#L27-L29

This is by design since protobuf generated code is supposed to match the runtime protobuf library version. When 4.x was released we had a lot of issues and I opened https://github.com/protocolbuffers/protobuf/issues/11123 to get some clarification. We know have some docs https://protobuf.dev/support/cross-version-runtime-guarantee/ which make it clear New Gencode + Old Runtime = Never Allowed. I.e. regenerating code with grpcio-tools 5 will break compatibility with protobuf 4.

This puts us in a tricky spot of choosing which major version to support. The good news is

Starting with the 2025Q1 release, the protobuf project will adopt a rolling compatibility window for major versions..

That doesn't help right now, but hopefully will for the next major version. Because they are planning to fix things, I'm hesitant on making our own solution like keeping two copies of generated code and dynamically choosing between them at import time.


Related

  • [ ] https://github.com/open-telemetry/opentelemetry-python/issues/3932#issuecomment-2146072966
  • [ ] https://github.com/open-telemetry/opentelemetry-python/pull/3931

aabmass avatar Jun 06 '24 17:06 aabmass