Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pymongo): add pin type check #11145

Merged
merged 14 commits into from
Oct 30, 2024
5 changes: 4 additions & 1 deletion ddtrace/contrib/internal/pymongo/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,10 @@ def _trace_topology_select_server(func, args, kwargs):
# Ensure the pin used on the traced mongo client is passed down to the topology instance
# This allows us to pass the same pin in traced server objects.
topology_instance = get_argument_value(args, kwargs, 0, "self")
ddtrace.Pin.get_from(topology_instance).onto(server)
pin = ddtrace.Pin.get_from(topology_instance)

if pin is not None:
pin.onto(server)
return server


Expand Down
Loading