Segment not showing in XRay trace for Router.post

0

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

已提問 3 年前檢視次數 387 次
1 個回答
0

Found the issue. Simple code check in issue. XRay code is working as expected.

Thanks,
Chris

已回答 3 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南