Hi, I'm using AWS RDS (Postgres) through TypeORM in a NestJs framework API.
I would like to enable tracing RDS with X-Ray, but I'm unable to do so as TypeORM handles creating the pg connection.
Can you point me in the right direction?
I found this issue but seems abandoned.
Hi @agustinhaller,
Thanks for the request. It seems that issue got closed due to a narrower PR, but a request for TypeORM support is noted. We've also recently added a generic SQL recorder in our Java SDK and are adding support for entity framework in .NET.
hi there,
would it be possible to make it work via
var mock = require('mock-require');
var AWSXRay = require('aws-xray-sdk');
var spiedPg = AWSXRay.capturePostgres(require('pg'));
mock('pg',spiedPg);
I'll give a try asap but if you have insights on why it could/could not work, it'd be cool :)
Best
Hi,
Using AWSXRay.capturePostgres(pg); seems to be enough in order to capture the requests to the database.
However, I could not find how to capture the SQL request as well. It seems there is some complicated ways to do it here though: https://docs.aws.amazon.com/xray/latest/devguide/xray-sdk-nodejs-sqlclients.html
Would be glad to have any insight on this issue :)
Hi @Nicoowr,
Currently the X-Ray SDK does not add SQL queries to subsegments, and the workaround you linked is the only way to add them at this point. We did not deem it secure to add queries with potentially sensitive information to subsegments by default. However we have been phasing in an option to add the query string to SQL subsegments on an opt-in basis, e.g. like they are in our .NET SDK. If you or another member of the community would be interested in making such a PR we'd be open to it!
Would really like TypeORM support
Hi,
I am using sequelize with mysql db for nodejs. DB Queries are not traced by x-ray.
Is it possible or not. Can you please tell me and may i know the status?
Thanks,
Raviteja
@ravitejavgyan this issue is open as a feature request for TypeORM instrumentation. Sequelize is a separate matter but also not directly supported yet.
@revmischa I do not have updates on adding TypeORM support in this SDK. However AWS X-Ray provides beta support for the OpenTelemetry JS SDK & API. There are extensions for the OpenTelemetry SDK that allow for TypeORM instrumentation. To learn more about OpenTelemetry JavaScript instrumentation with X-Ray as the backend, you can checkout the documentation and our AWS Observability repos.
Most helpful comment
Would really like TypeORM support