aws / aws-xray-sdk-node

The official AWS X-Ray SDK for Node.js.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Consider supporting SQL annotations for Athena calls.

kitsunde opened this issue · comments

Hello,

I understand X-Ray currently only support MySQL and Postgres drivers. We use the Postgres annotation frequently to investigate issues, it would be nice if SQL annotations could be added for athena as well.

Hi, can you clarify what is your requirement?

If your goal is to add an XRay Annotation to an Athena subsegment (presumable made via AWS SDK), you can try the following code example to add an annotation to the last created subsegment. (referenced from docs)

/*
  Athena call via AWS SDK
*/

// Retrieve the most recently created subsegment
const subs = AWSXRay.getSegment().subsegments;

if (subs & & subs.length > 0) {
  var lastSubsegment = subs[subs.length - 1];
  lastSubsegment.addAnnotation("testKey", "testValue");
}