aws-otel-php
aws-otel-php copied to clipboard
Recording SQL statements in traces for X-Ray
Hi again,
I've been reading that X-Ray has a dedicated set of annotation fields for tracing SQL: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html#api-segmentdocuments-sql
I'm connecting a PHP app to an RDS Aurora (MySQL) database and I'd like to trace the SQL calls, and ideally see RDS as a node in the service map.
I currently have my SQL statements added as standard annotations, however ideallyI could use the x-ray sql segment fields, and ideally that would show RDS as a node in X-Ray.
I'm currently just doing this:
$span->setAttributes(['sql' => $query, 'params' => $params]);
It works, but I don't get any sort of visibility into DB usage, load, etc.
Not sure if this is a supported feature I've missed, or a feature request for future.
Thanks, Scott