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

feita há 3 anos387 visualizações
1 Resposta
0

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

Thanks,
Chris

respondido há 3 anos

Você não está conectado. Fazer login para postar uma resposta.

Uma boa resposta responde claramente à pergunta, dá feedback construtivo e incentiva o crescimento profissional de quem perguntou.

Diretrizes para responder a perguntas