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

posta 3 anni fa387 visualizzazioni
1 Risposta
0

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

Thanks,
Chris

con risposta 3 anni fa

Accesso non effettuato. Accedi per postare una risposta.

Una buona risposta soddisfa chiaramente la domanda, fornisce un feedback costruttivo e incoraggia la crescita professionale del richiedente.

Linee guida per rispondere alle domande