You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our Python microservice running on Kubernetes is working, but the following error occurs when adding "admission.datadoghq.com/python-lib.version" : "v2.10.1" to it.
File "/KA/python_processing/services/__init__.py", line 10, in <module>
from .resource_service import ResourceService
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 "/datadog-lib/ddtrace_pkgs/site-packages-ddtrace-py3.12-manylinux2014/ddtrace/internal/module.py", line 250, in _exec_module
self.loader.exec_module(module)
File "/KA/python_processing/services/resource_service.py", line 7, in <module>
class ResourceService:
File "/KA/python_processing/services/resource_service.py", line 12, in ResourceService
def __init__(self, mongo_client: pymongo.MongoClient[Dict[str, Any]]):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: type 'TracedMongoClient' is not subscriptable
Removing the use of type checkers in our Python microservices solves temporarily the issue, but we need to use type checkers. So we expect dd-trace-py to be compatible with type checkers.
Which version of dd-trace-py are you using?
2.10.1
Which version of pip are you using?
Python 3.12
Which libraries and their versions are you using?
PyMongo version 4.6.3
How can we reproduce your problem?
Use PyMongo version 4.6.3 and type hints in a Python microservice then add Datadog Python library version 2.10.1 to instrument this microservice.
What is the result that you get?
Our Python microservice crashed with this error
File "/KA/python_processing/services/__init__.py", line 10, in <module>
from .resource_service import ResourceService
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 "/datadog-lib/ddtrace_pkgs/site-packages-ddtrace-py3.12-manylinux2014/ddtrace/internal/module.py", line 250, in _exec_module
self.loader.exec_module(module)
File "/KA/python_processing/services/resource_service.py", line 7, in <module>
class ResourceService:
File "/KA/python_processing/services/resource_service.py", line 12, in ResourceService
def __init__(self, mongo_client: pymongo.MongoClient[Dict[str, Any]]):
~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
TypeError: type 'TracedMongoClient' is not subscriptable
What is the result that you expected?
Our Python microservice should run without any error when Datadog Python library version 2.10.1 is added to instrument this microservice.
The text was updated successfully, but these errors were encountered:
Summary of problem
Our Python application is using type checkers and the library PyMongo. "As of version 4.1, PyMongo ships with type hints. With type hints, Python type checkers can easily find bugs before they reveal themselves in your code."
Source: https://pymongo.readthedocs.io/en/stable/examples/type_hints.html
Our Python microservice running on Kubernetes is working, but the following error occurs when adding "admission.datadoghq.com/python-lib.version" : "v2.10.1" to it.
Removing the use of type checkers in our Python microservices solves temporarily the issue, but we need to use type checkers. So we expect dd-trace-py to be compatible with type checkers.
Which version of dd-trace-py are you using?
2.10.1
Which version of pip are you using?
Python 3.12
Which libraries and their versions are you using?
PyMongo version 4.6.3
How can we reproduce your problem?
Use PyMongo version 4.6.3 and type hints in a Python microservice then add Datadog Python library version 2.10.1 to instrument this microservice.
What is the result that you get?
Our Python microservice crashed with this error
What is the result that you expected?
Our Python microservice should run without any error when Datadog Python library version 2.10.1 is added to instrument this microservice.
The text was updated successfully, but these errors were encountered: