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

[pymongo] Fix multiple host kwarg #535

Merged
merged 3 commits into from
Aug 13, 2018
Merged

[pymongo] Fix multiple host kwarg #535

merged 3 commits into from
Aug 13, 2018

Conversation

Kyle-Verhoog
Copy link
Member

@Kyle-Verhoog Kyle-Verhoog commented Aug 9, 2018

Overview

This PR adds a fix for the bug demonstrated in #369.

Background

Due to supporting deprecated code, a hack existed that used the first argument passed to the TracedMongoClient. The first argument passed to MongoClient was host. This bug would occur when host was provided explicitly as a kwarg.

@Kyle-Verhoog Kyle-Verhoog added this to the 0.13.0 milestone Aug 9, 2018
@Kyle-Verhoog Kyle-Verhoog self-assigned this Aug 9, 2018
@Kyle-Verhoog
Copy link
Member Author

@deprecated(message='Use patching instead (see the docs).', version='1.0.0')
def trace_mongo_client(client, tracer, service=mongox.TYPE):
tracer.set_service_info(
service=service,
app=mongox.TYPE,
app_type=AppTypes.db,
)
traced_client = TracedMongoClient(client)
ddtrace.Pin(service=service, tracer=tracer).onto(traced_client)
return traced_client

We should consider moving this since it is the reason why the bug exists and this workaround fix is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants