Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWSXRay.captureAsyncFunc() from Lambda - am I missing something?

I'm trying to get a custom X-Ray segment reporting, but I'm not seeing anything in the trace. My code looks something like this:

var AWSXRay = require('aws-xray-sdk-core');

AWSXRay.captureAsyncFunc('callSoapService', subsegment => {
  doSomethingAsync(params, err => {
    if (err) {
      subsegment.close(err);
    } else {
      doSomethingElse().then(result => {
        console.info('all done, now close the segment');
        subsegment.close();
      }, subsegment.close);
    }
  });
});

Do I need to add it to the parent segment or something?

like image 528
Nicholas Albion Avatar asked Sep 12 '25 11:09

Nicholas Albion


1 Answers

ugh. there seems to be a bug with AWSXRay.captureHTTPs() - if I remove that call captureAsyncFunc() starts working

like image 75
Nicholas Albion Avatar answered Sep 15 '25 01:09

Nicholas Albion