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

ISSUE-80: Add patch support for psycopg2 #83

Merged
merged 10 commits into from
Aug 31, 2018
Merged

Conversation

Tankanow
Copy link
Contributor

Issue 80

Add patch support for psycopg2 using existing dbapi2 tracing classes. For now, add host, database, user, and database_type to sql metadata.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.


conn = wrapped(*args, **kwargs)
meta = {
'database_type': 'postgresql',
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@haotianw465, how do I see the custom metadata in XRay? I system tested this code by deploying it along with one of my Lambda functions; I did see the correct database_type, however I did not see database_host, database_name, or database_user in the Raw Trace Data in the AWS XRay Console.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The service will drop unknown keys. Here is a sample sql document the service support.

"sql" : {
     "url": "jdbc:postgresql://aawijb5u25wdoy.cpamxznpdoq8.us-west-2.rds.amazonaws.com:5432/ebdb",
     "preparation": "statement",
     "database_type": "PostgreSQL",
     "database_version": "9.5.4",
     "driver_version": "PostgreSQL 9.4.1211.jre7",
     "user" : "dbuser"
}

@Tankanow
Copy link
Contributor Author

@haotianw465, I updated the metadata and confirmed via system test that it shows up in the AWS XRay Console. Please let me know if there is anything else I should do for this PR.

@haotianw465 haotianw465 merged commit 461d488 into aws:master Aug 31, 2018
@haotianw465
Copy link
Contributor

Thank you for your contribution. I have merged your PR and will roll it out in our next release.

@Tankanow Tankanow mentioned this pull request Sep 1, 2018
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.

2 participants