-
Notifications
You must be signed in to change notification settings - Fork 98
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
SQL tracing: Support safely capturing parameterized SQL queries #28
Comments
Hi grobmeier, Originally, we had a concern raised around the fact the query may contain sensitive data, and how recording this automatically to X-Ray could leak this data. We had experimented in making our own sanitizer (as seen in the commented out SanitizeTest) but this was deemed insufficient, and the sanitizer and 'sanitized_query' parameter were removed, pending investigation on a better solution. You can see the MySQL parameters captured here. Line 157 in 3e0b21c
Other SDKs do have the 'sanitized_query' parameter for specific drivers that have built-in support for sanitizing/filtering queries (such as SQLAlchemy for Python). But, we do not yet have a solution for the MySQL driver on Java. Similar question posted in the Node SDK GitHub: aws/aws-xray-sdk-node#9 Let me know if you have any questions. Thanks! |
Any updates on this issue? |
Hi @svetozar02, |
Would it be possible for have an option of enabling it if users actually want it? Other option is to look at how Datadog agent is obfuscating sql... |
if not automatic, is there any guidance on a hook consumers can do in code to provide the instrumentation the sql manually? |
The docs for the node sdk provided a tip that also works for the Java sdk https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-sqlclients.html |
Hi all, Sorry for the delay in response here. You can capture SQL queries automatically with the X-Ray Java Agent. You just have to opt-in by setting the In the meantime, this small feature is in our backlog to add to the Java SDK, and we are also always open to pull requests. We need to make this opt in via an environment variable like |
* Opt-in support to collect SQL queries. #28 * Update aws-xray-recorder-sdk-sql/src/main/java/com/amazonaws/xray/sql/TracingStatement.java Changing name of system property to AWS XRAY standard. Co-authored-by: William Armiros <54150514+willarmiros@users.noreply.github.com> * Checkstyle line length fix. * Documentation for opt-in SQL-recording. Co-authored-by: stnor <stefan@selessia.com> Co-authored-by: William Armiros <54150514+willarmiros@users.noreply.github.com>
I am running a Spring webapp with this configuration:
dataSource.setJdbcInterceptors("com.amazonaws.xray.sql.mysql.TracingInterceptor;");
Debugging confirms I am running into the TracingInterceptor and inside that, I can even see the sql inside the TracingInterceptor.
However, in the AWS XRay Console I cannot see the SQL commandos fired, just some meta data (like connection information).
Am I supposed to see the raw SQL running against a database? If yes, is there any additional step I missed?
The text was updated successfully, but these errors were encountered: