DX Application Performance Management

  • 1.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)

    Posted Mar 30, 2017 11:39 AM

    Hei Sergio.

    I succeded in installing the ca-apm-probe on the linux box

    Now I have a javascript ca-apm-probe.js on the folder 

    /prod/CA/wily4NodeJS/node_modules/ca-apm-probe/bin

     

    But my nodejs app starts with the command

     

    pm2 start server.js -i 4 --name chunk-upload-node-js

     

    How can i monitor this process with the ca-apm-probe?

     

     



  • 2.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)

    Broadcom Employee
    Posted Mar 30, 2017 12:01 PM

    Luca:

    The original question has been successfully answered. So marking as correct. Will attempt to get a response to your follow-up question.Branched to a new question



  • 3.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)
    Best Answer

    Broadcom Employee
    Posted Mar 31, 2017 03:34 AM

    Hi Luca,

    Looks like ca-apm-run command (no code change) is not supported for pm2. You  have to manually configure probe is application startup script


    https://docops.ca.com/ca-apm/10-1/en/implementing-agents/node-js-agent/install-the-node-js-agent/install-and-run-the-node-js-probe-agent#InstallandRuntheNode.jsProbeAgent-InstallandManuallyConfiguretheNode.jsProbeAgentasanApplicationDependency(CodeChange)

     

    In order to separate metrics/traces per process, you have to set "probeName": "${name}-${NODE_APP_INSTANCE}", in probe config.js.

    Looks like we did not cover cluster support nodejs in docops, I have asked documentation team to include this information.

    See attached word doc Node.JS Cluster Support.docx 

     

    Regards,
    Sergio



  • 4.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)

    Posted Mar 31, 2017 04:19 AM

    Ciao Sergio

    I tried but I get the error:

    module.js:471
    throw err;
    ^

    Error: Cannot find module 'ca-apm-probe'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)

     

    I think that the ca-apm-probe is installed in a different path from the Nodejs application

    Can I give the server.js the right path to include the ca-apm-probe?



  • 5.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)

    Posted Mar 31, 2017 04:34 AM

    I started the script via pm2 and the app is online

    Is it possible to see if the probe is working ?



  • 6.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)

    Posted Mar 31, 2017 04:37 AM

    Really the apps are dead with this error

    Error: Cannot find module 'ca-apm-probe'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/wasup/ChunkUploadNodeJS/server.js:3:37)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)



  • 7.  Re: Node.js monitor How to download the ca-apm-probe? (Node.js agent)

    Posted Mar 31, 2017 08:30 AM

    Hello Sergio.

    I solved the problem inserting the probe in the server.js script.

    • The only probelm i faced is that the probe must be installed in the home of the Node.js application
    • And also the user that starts the node.js app must be owner of the ca-apm-probe folder to write logs

     

    Than you