Skip to content

[BUG]: pymongo >=4.12 does not report spans #13684

Open
@kamilbednarz

Description

@kamilbednarz

Tracer Version(s)

3.9.1

Python Version(s)

3.11.9

Pip Version(s)

25.0.1

Bug Report

ddtrace seems to not report pymongo spans to datadog in latest versions of pymongo.
Main API traces are visible, but all the pymongo computing time contributes toward main python span.

Recently we did pymongo upgrade and here are my observations re: versions that worked fine/do not work:
✅ pymongo 4.6.x & motor 3.1.1
✅ pymongo 4.9.x & motor 3.7.1
✅ pymongo 4.10.x & motor 3.7.1
✅ pymongo 4.11.x & motor 3.7.1
🔴 pymongo 4.12.x & motor 3.7.1
🔴 pymongo 4.13.x & motor 3.7.1

The patching code is not changed between versions.
Application runtime is not wrapped with ddtrace-run.

I tried different startup methods:

  • ddtrace-run
  • import ddtrace.auto
    None of them helped so it makes me suspect that maybe the ddtrace package & its patching code is just not compatible with latest pymongo versions.

LMK if you need any more details to reproduce/troubleshoot.

Reproduction Code

from ddtrace import patch_all, config
patch_all(all=True)

Error Logs

No errors are reported by ddtrace.

Libraries in Use

pymongo==4.13.0
motor==3.7.1
ddtrace==3.9.1

Operating System

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions