Open
Description
NewRelic is incompatible with ChromaDB due to conflicting openetelemetry
protos
Description
When using newrelic-python
in conjunction with chromadb
(or any dependency really using chromadb
, crewai
for example), import errors caused by mismatching proto versions prevent the app from starting up & working. Other threads mentioning setting settings.debug.otlp_content_encoding = "json"
unfortunately don't really work when NewRelic is used with the newrelic-admin
wrapper script, as the OLTP imports in NewRelic run before any of the application code is hit & could change that settings.
Expected Behavior
NewRelic works with any other dependency.
Full stacktrace:
Traceback (most recent call last):
File "/generic/path/python/bin/celery", line 8, in <module>
sys.exit(main())
File "/generic/path/python/lib/python3.12/site-packages/celery/__main__.py", line 15, in main
sys.exit(_main())
File "/generic/path/python/lib/python3.12/site-packages/celery/bin/celery.py", line 236, in main
return celery(auto_envvar_prefix="CELERY")
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/generic/path/python/lib/python3.12/site-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/click/decorators.py", line 33, in new_func
return f(get_current_context(), *args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/celery/bin/base.py", line 135, in caller
return f(ctx, *args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/celery/bin/worker.py", line 348, in worker
worker = app.Worker(
File "/generic/path/python/lib/python3.12/site-packages/celery/worker/worker.py", line 93, in __init__
self.app.loader.init_worker()
File "/generic/path/python/lib/python3.12/site-packages/celery/loaders/base.py", line 110, in init_worker
self.import_default_modules()
File "/generic/path/python/lib/python3.12/site-packages/celery/loaders/base.py", line 104, in import_default_modules
raise response
File "/generic/path/python/lib/python3.12/site-packages/celery/utils/dispatch/signal.py", line 276, in send
response = receiver(signal=self, sender=sender, **named)
File "/generic/path/python/lib/python3.12/site-packages/celery/fixups/django.py", line 100, in on_import_modules
self.worker_fixup.validate_models()
File "/generic/path/python/lib/python3.12/site-packages/celery/fixups/django.py", line 140, in validate_models
run_checks()
File "/generic/path/python/lib/python3.12/site-packages/django/core/checks/registry.py", line 88, in run_checks
new_errors = check(app_configs=app_configs, databases=databases)
File "/generic/path/python/lib/python3.12/site-packages/django/core/checks/urls.py", line 136, in check_custom_error_handlers
handler = resolver.resolve_error_handler(status_code)
File "/generic/path/python/lib/python3.12/site-packages/newrelic/hooks/framework_django.py", line 598, in wrapper
return wrapped(*args, **kwargs)
File "/generic/path/python/lib/python3.12/site-packages/django/urls/resolvers.py", line 732, in resolve_error_handler
callback = getattr(self.urlconf_module, "handler%s" % view_type, None)
File "/generic/path/python/lib/python3.12/site-packages/django/utils/functional.py", line 47, in __get__
res = instance.__dict__[self.name] = self.func(instance)
File "/generic/path/python/lib/python3.12/site-packages/django/urls/resolvers.py", line 711, in urlconf_module
return import_module(self.urlconf_name)
File "/generic/path/python/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/generic/path/app/urls.py", line 43, in <module>
path("app/", include("app.urls")),
File "/generic/path/python/lib/python3.12/site-packages/django/urls/conf.py", line 39, in include
urlconf_module = import_module(urlconf_module)
File "/generic/path/python/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/generic/path/app/urls.py", line 3, in <module>
File "/generic/path/app/views.py", line 8, in <module>
File "/generic/path/app/serializers.py", line 23, in <module>
File "/generic/path/app/processing/auto_reconciler.py", line 23, in <module>
File "/generic/path/app/processing/multi_step.py", line 13, in <module>
File "/generic/path/app/crew.py", line 1, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/__init__.py", line 3, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/agent.py", line 8, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/agents/__init__.py", line 2, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/agents/parser.py", line 6, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/utilities/__init__.py", line 13, in <module>
File "/generic/path/python/lib/python3.12/site-packages/crewai/utilities/embedding_configurator.py", line 4, in <module>
File "/generic/path/python/lib/python3.12/site-packages/chromadb/__init__.py", line 6, in <module>
File "/generic/path/python/lib/python3.12/site-packages/chromadb/auth/token_authn/__init__.py", line 24, in <module>
from chromadb.telemetry.opentelemetry import (
File "/generic/path/python/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 13, in <module>
File "/generic/path/python/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 "/generic/path/python/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 "/generic/path/python/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/common/_internal/__init__.py", line 30, in <module>
File "/generic/path/python/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
List of dependencies to reproduce
aiohappyeyeballs==2.6.1
aiohttp==3.11.14
aiosignal==1.3.2
amazon-textract-caller==0.2.4
amazon-textract-response-parser==1.0.3
amazon-textract-textractor==1.9.0
amqp==5.3.1
annotated-types==0.7.0
anyio==4.9.0
appdirs==1.4.4
asgiref==3.8.1
asttokens==3.0.0
attrs==25.3.0
auth0-python==4.8.1
backoff==2.2.1
bcrypt==4.3.0
billiard==4.2.1
blinker==1.9.0
boto3==1.37.15
botocore==1.37.15
build==1.2.2.post1
cachetools==5.5.2
celery==5.4.0
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
chroma-hnswlib==0.7.6
chromadb==0.6.3
click==8.1.8
click-didyoumean==0.3.1
click-plugins==1.1.1
click-repl==0.3.0
coloredlogs==15.0.1
crewai==0.108.0
cryptography==44.0.2
CurrencyConverter @ git+https://github.com/alexprengere/currencyconverter.git@932d1316ba4578032896f5156fa91dbb602f6402
dataclasses-json==0.6.7
decorator==5.2.1
Deprecated==1.2.18
distro==1.9.0
dj-database-url==2.3.0
Django==5.1.7
django-anymail==12.0
django-cors-headers==4.7.0
django-filter==25.1
django-storages==1.14.5
djangorestframework==3.15.2
docstring_parser==0.16
durationpy==0.9
editdistance==0.8.1
enum-compat==0.0.3
et_xmlfile==2.0.0
executing==2.2.0
fastapi==0.115.11
filelock==3.18.0
flatbuffers==25.2.10
frozenlist==1.5.0
fsspec==2025.3.0
google-api-core==2.24.2
google-auth==2.38.0
google-cloud-bigquery==3.30.0
google-cloud-core==2.4.3
google-cloud-storage==3.1.0
google-crc32c==1.7.0
google-resumable-media==2.7.2
googleapis-common-protos==1.69.2
greenlet==3.1.1
grpcio==1.71.0
grpcio-status==1.71.0
gunicorn==23.0.0
h11==0.14.0
httpcore==1.0.7
httptools==0.6.4
httpx==0.27.2
httpx-sse==0.4.0
huggingface-hub==0.29.3
humanfriendly==10.0
idna==3.10
importlib_metadata==8.5.0
importlib_resources==6.5.2
instructor==1.7.7
intuit-oauth==1.2.6
ipython==9.0.2
ipython_pygments_lexers==1.1.1
jedi==0.19.2
Jinja2==3.1.6
jiter==0.8.2
jmespath==1.0.1
josepy==2.0.0
json5==0.10.0
json_repair==0.39.1
jsonpatch==1.33
jsonpickle==4.0.2
jsonpointer==3.0.0
jsonref==1.1.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
kombu==5.5.0
kubernetes==32.0.1
langchain==0.3.20
langchain-community==0.3.19
langchain-core==0.3.45
langchain-openai==0.3.9
langchain-text-splitters==0.3.7
langfuse==2.60.0
langsmith==0.3.15
Levenshtein==0.27.1
litellm==1.60.2
markdown-it-py==3.0.0
markdown2==2.5.3
MarkupSafe==3.0.2
marshmallow==3.26.1
matplotlib-inline==0.1.7
mdurl==0.1.2
mmh3==5.1.0
monotonic==1.6
mozilla-django-oidc==4.0.1
mpmath==1.3.0
multidict==6.2.0
mypy-extensions==1.0.0
networkx==3.4.2
newrelic==10.7.0
nulltype==2.3.1
numpy==2.2.4
oauthlib==3.2.2
onnxruntime==1.21.0
openai==1.66.3
openpyxl==3.1.5
opentelemetry-api==1.29.0
opentelemetry-exporter-otlp-proto-common==1.29.0
opentelemetry-exporter-otlp-proto-grpc==1.29.0
opentelemetry-exporter-otlp-proto-http==1.29.0
opentelemetry-instrumentation==0.50b0
opentelemetry-instrumentation-asgi==0.50b0
opentelemetry-instrumentation-fastapi==0.50b0
opentelemetry-proto==1.29.0
opentelemetry-sdk==1.29.0
opentelemetry-semantic-conventions==0.50b0
opentelemetry-util-http==0.50b0
orjson==3.10.15
overrides==7.7.0
packaging==24.2
pandas==2.2.3
parso==0.8.4
pdfminer.six==20231228
pdfplumber==0.11.5
pexpect==4.9.0
pillow==11.1.0
plaid-python==29.1.0
posthog==3.21.0
prompt_toolkit==3.0.50
propcache==0.3.0
proto-plus==1.26.1
protobuf==5.29.3
psycopg2==2.9.10
ptyprocess==0.7.0
pure_eval==0.2.3
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycparser==2.22
pydantic==2.10.6
pydantic-settings==2.8.1
pydantic_core==2.27.2
Pygments==2.19.1
PyJWT==2.10.1
pypdfium2==4.30.1
PyPika==0.48.9
pyproject_hooks==1.2.0
python-dateutil==2.9.0.post0
python-dotenv==1.0.1
python-Levenshtein==0.27.1
python-quickbooks==0.9.11
python-redis-lock==4.0.0
pytz==2025.1
pyvis==0.3.2
PyYAML==6.0.2
RapidFuzz==3.12.2
redis==5.2.1
referencing==0.36.2
regex==2024.11.6
requests==2.32.3
requests-oauthlib==2.0.0
requests-toolbelt==1.0.0
rich==13.9.4
rpds-py==0.23.1
rsa==4.9
s3transfer==0.11.4
sentry-sdk==2.23.1
setuptools==70.3.0
shellingham==1.5.4
six==1.17.0
sniffio==1.3.1
SQLAlchemy==2.0.39
sqlparse==0.5.3
stack-data==0.6.3
starlette==0.46.1
stripe==11.6.0
sympy==1.13.3
tabulate==0.9.0
tenacity==9.0.0
thefuzz==0.22.1
tiktoken==0.9.0
tokenizers==0.21.1
tomli==2.2.1
tomli_w==1.2.0
tqdm==4.67.1
traitlets==5.14.3
typer==0.15.2
typing-inspect==0.9.0
typing_extensions==4.12.2
tzdata==2025.1
urllib3==2.3.0
uv==0.6.8
uvicorn==0.34.0
uvloop==0.21.0
vine==5.1.0
watchdog==6.0.0
watchfiles==1.0.4
wcwidth==0.2.13
websocket-client==1.8.0
websockets==15.0.1
wheel==0.45.1
wrapt==1.17.2
XlsxWriter==3.2.2
yarl==1.18.3
zipp==3.21.0
zstandard==0.23.0