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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠