installing xds-proto breaks opentelemetry-proto

未关闭
#4,843 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
python
领域
tooling

调研方向

首先重现 opentelemetry.proto.common.v1.common_pb2.InstrumentationScope 的安装过程和导入失败。比较已安装的 opentelemetry-proto 和 xds-protos 软件包的内容及元数据,以确定冲突的文件。安装 xds-protos 后,无需重新安装 opentelemetry-proto,导入仍能正常工作,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug
Describe your environment

OS: (e.g, Ubuntu)
Python version: (e.g., Python 3.11.2)
SDK version: (e.g., 1.39.0)
API version: (e.g., 1.39.0)

What happened?

after installing xds-proto some opentelemetry-proto files becomes broken

Steps to Reproduce
$ uv pip uninstall xds-protos opentelemetry-proto
warning: Skipping opentelemetry-proto as it is not installed
warning: Skipping xds-protos as it is not installed
warning: No packages to uninstall

$ uv pip install opentelemetry-proto
 + opentelemetry-proto==1.39.0
 + protobuf==6.33.2

$ python -c "from opentelemetry.proto.common.v1.common_pb2 import InstrumentationScope"
// everything is fine

$ uv pip install xds-protos
 + grpcio==1.76.0
 + typing-extensions==4.15.0
 + xds-protos==1.76.0

$ python -c "from opentelemetry.proto.common.v1.common_pb2 import InstrumentationScope"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: cannot import name 'InstrumentationScope' from 'opentelemetry.proto.common.v1.common_pb2'

reinstalling opentelemetry-proto after it fixes ImportError

Expected Result

no ImportError after installing xds-proto

Actual Result

ImportError

Additional context

No response

Would you like to implement a fix?

None

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

主要语言
Python
星标
2.7k
派生
1.1k
平均合并
3 天 12 小时
30 天内合并 PR
16

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

open-telemetry/opentelemetry-python 的其他 Issue

查看 open-telemetry/opentelemetry-python 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。