-
Notifications
You must be signed in to change notification settings - Fork 143
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
Conversation
aws_xray_sdk/ext/psycopg2/patch.py
Outdated
|
||
conn = wrapped(*args, **kwargs) | ||
meta = { | ||
'database_type': 'postgresql', |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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"
}
…an compare versions
@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. |
Thank you for your contribution. I have merged your PR and will roll it out in our next release. |
Issue 80
Add patch support for psycopg2 using existing
dbapi2
tracing classes. For now, addhost
,database
,user
, anddatabase_type
tosql
metadata.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.