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

asked 3 years ago381 views
1 Answer
0

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

Thanks,
Chris

answered 3 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions