Search code examples
aws-xray

aws xray: Missing sql query and django user in traces


I do get traces, and the traces do not contain the query as explained in the docs

only:

"sql": { "database_type": "mysql", "user": "******" }

Do I need to add anything in RDS to allow for this to work?

in the django settings? somewhere else?

I'm also missing the actual user, ( I do get the correct user Ip and browser agent, but not the authenticated user)

Using the official python sdk with the django middleware and the following stack:

Django 1.11 xray 2.1.0 Daemon 3 Connected to RDS mysql db


Solution

  • The X-Ray SDKs don't support the query capture unless there is a reliable way to log the parameterized ones. For Python SDK only SQLAlchemy supports such capture. You can see the full response in the AWS X-Ray forum: https://forums.aws.amazon.com/thread.jspa?threadID=290748&tstart=0.