Protobuf Duplicate File Error in OpenTelemetry Dependencies
When import arize.otel in an application that uses NewRelic (another observability tool our company uses) I receive the following error:
uv run main.py --python 3.12
Reading inline script metadata from `main.py`
Traceback (most recent call last):
File ".../projects/observ/main.py", line 9, in <module>
from arize.otel import register # noqa
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".../.cache/uv/archive-v0/pGC9a5N5BIwXV7OP8xZwU/lib/python3.12/site-packages/arize/otel/__init__.py", line 3, in <module>
from .otel import (
File ".../.cache/uv/archive-v0/pGC9a5N5BIwXV7OP8xZwU/lib/python3.12/site-packages/arize/otel/otel.py", line 10, in <module>
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import (
File ".../.cache/uv/archive-v0/pGC9a5N5BIwXV7OP8xZwU/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py", line 22, in <module>
from opentelemetry.exporter.otlp.proto.common.trace_encoder import (
File ".../.cache/uv/archive-v0/pGC9a5N5BIwXV7OP8xZwU/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/common/trace_encoder.py", line 16, in <module>
from opentelemetry.exporter.otlp.proto.common._internal.trace_encoder import (
File ".../.cache/uv/archive-v0/pGC9a5N5BIwXV7OP8xZwU/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py", line 32, in <module>
from opentelemetry.proto.common.v1.common_pb2 import AnyValue as PB2AnyValue
File ".../.cache/uv/archive-v0/pGC9a5N5BIwXV7OP8xZwU/lib/python3.12/site-packages/opentelemetry/proto/common/v1/common_pb2.py", line 16, in <module>
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: Couldn't build proto file into descriptor pool: duplicate file name opentelemetry/proto/common/v1/common.proto
The error is caused by a duplicate file error in the protobuf package.
This issue is common when using multiple observability tools that depend on OpenTelemetry but potentially different versions of its components.
Steps to Reproduce
- Add the following code to
main.py:
# /// script
# dependencies = [
# "arize-otel>=0.8.0",
# "newrelic>=10.7.0",
# ]
# ///
import newrelic.agent # noqa
from arize.otel import register # noqa
- Run the application with
uv run main.py
Environment Details
- Operating System: macOS
- python version: 3.12.7
uv pip freeze
arize-otel==0.8.0
certifi==2025.1.31
charset-normalizer==3.4.1
deprecated==1.2.18
googleapis-common-protos==1.69.2
grpcio==1.71.0
idna==3.10
importlib-metadata==8.6.1
newrelic==10.7.0
openinference-instrumentation==0.1.24
openinference-semantic-conventions==0.1.15
opentelemetry-api==1.31.0
opentelemetry-exporter-otlp==1.31.0
opentelemetry-exporter-otlp-proto-common==1.31.0
opentelemetry-exporter-otlp-proto-grpc==1.31.0
opentelemetry-exporter-otlp-proto-http==1.31.0
opentelemetry-proto==1.31.0
opentelemetry-sdk==1.31.0
opentelemetry-semantic-conventions==0.52b0
protobuf==5.29.3
requests==2.32.3
typing-extensions==4.12.2
urllib3==2.3.0
wrapt==1.17.2
zipp==3.21.0
Details
Changing the order of the imports seems to stop the error. But we launch our app with the entrypoint "newrelic-admin run-program uvicorn main.app ..." so it does not solve the problem because in this case we cannot change the import order.
Protobuf Duplicate File Error in OpenTelemetry Dependencies
When import arize.otel in an application that uses NewRelic (another observability tool our company uses) I receive the following error:
The error is caused by a duplicate file error in the protobuf package.
This issue is common when using multiple observability tools that depend on OpenTelemetry but potentially different versions of its components.
Steps to Reproduce
main.py:uv run main.pyEnvironment Details
Details
Changing the order of the imports seems to stop the error. But we launch our app with the entrypoint "newrelic-admin run-program uvicorn main.app ..." so it does not solve the problem because in this case we cannot change the import order.