Hello,
I'm trying to add a XRay segment to my NodeJs code that user express router to process incoming POST requests. I've added the openSegment/closeSegment calls around my router.post() method, but I don't see the segment in the XRay trace. I'm very new to this, so I'm probably missing something. Any help would be appreciated. Source code below:
var AWSXRay = require('aws-xray-sdk');
const XRayExpress = AWSXRay.express;
const router = require("express").Router();
const DB = require("../../db/oracle/oracleDB");
router.use(XRayExpress.openSegment('MemberGroupId'));
/**
- POST route
*/
router.post("/", async (req, res) => {
const { patientId, dbName } = req.body;
let memberLookUpObj = {
payload: {
cardHolderId: "",
groupId: "",
relationshipCode: "",
},
msg: "",
};
... remaining source
});
router.use(XRayExpress.closeSegment());
Thanks,
Chris