DX Application Performance Management

Expand all | Collapse all

Does ca-apm-probe have typescript support?

Jump to Best Answer

Wan Fei Chee03-15-2018 07:17 PM

Wan Fei Chee03-26-2018 07:01 PM

  • 1.  Does ca-apm-probe have typescript support?

    Posted 03-13-2018 09:55 AM

    Hello folks,

     

    What is the plan on making the ca-apm-probe dependency compatible with typescript? It currently is not.



  • 2.  Re: Does ca-apm-probe have typescript support?
    Best Answer

    Posted 03-14-2018 09:29 PM

    Hi Danilo,

    For this node.js agent enhancement I would suggest adding an Idea with your justification for other community members to vote on.

    Then it is also more visible to APM Product Management to respond to.

     

    Thanks

     

    Lynn



  • 3.  Re: Does ca-apm-probe have typescript support?

    Posted 03-15-2018 07:17 PM


  • 4.  Re: Does ca-apm-probe have typescript support?

    Posted 03-20-2018 05:38 PM

    Hi DanJSBR,

     

    I got this input from our engineering team and thought I would share with you.

     

    For Code Change option to configure nodejs probe on TS app, User need to add the following as first line to application main entry point script (for example, server.ts).

     

    import * as probe from 'ca-apm-probe';

    probe.start(<Infrastructure-agent-host>, <Infrastructure-agent-port>, <probe-name>);

     

    Note: this snippet is different from nodejs app snippet.

     

    TS App

     TypeScript App

     

    Since, .ts files get compiled into .js files, and this is what node runtime sees. No-Code-Change options for nodejs probe should work as it is.

     

    Hope this helps.

     

    Regards,

    Aryne



  • 5.  Re: Does ca-apm-probe have typescript support?

    Posted 03-20-2018 06:27 PM

    Hi Aryne

     

    I tried the following suggestion and here are my findings so far

     

    When launching this app on docker, the following syntax error happens. I'm not sure why that is but it causes a Problem when I add the dependency on app.ts

     

     

    Internal nodejscollector
    Internal NodejsCollector. Will send metrics to 10.127.186.82:5005 with appName backend
    [CA APM PROBE] monitoring application with pid 1
    [CA APM PROBE] Log file location: /usr/local/lib/node_modules/ca-apm-probe/logs/Probe-backend_devops.log
    /opt/app/src/app.ts:1
    (function (exports, require, module, __filename, __dirname) { import { AssetLegalVehicleRepository } from './sql/repositories/asset-legal-vehicle.repository';
    ^^^^^^
    SyntaxError: Unexpected token import
    at Object.exports.runInThisContext (vm.js:76:16)
    at Module._compile (module.js:542:28)
    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)
    at Object.<anonymous> (/usr/local/lib/node_modules/ca-apm-probe/bin/ca-apm-run.js:32:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)

     

    Any idea why does that happen?



  • 6.  Re: Does ca-apm-probe have typescript support?

    Posted 03-20-2018 10:20 PM

    Thanks for the feedback DanJSBR, let me check with the team and revert.



  • 7.  Re: Does ca-apm-probe have typescript support?

    Posted 03-20-2018 10:41 PM

    Hi DanJSBR, it looks like you are using the No-Code-Change option, instead of the snippet one. Would you mind sharing the command you used to start the app please?



  • 8.  Re: Does ca-apm-probe have typescript support?

    Posted 03-21-2018 06:01 AM

    Hi Aryne

     

    the app is started by the command defined in package.json : 

     

    "scripts": {
    "start": "ts-node src/app.ts --fast",
    "ts-node": "ts-node",
    "tslint": "tslint",
    "prestart": "cd ./node_modules/oracledb && node ../node-gyp/bin/node-gyp.js rebuild && cd ../../"
    },


  • 9.  Re: Does ca-apm-probe have typescript support?

    Posted 03-21-2018 09:53 AM

    One extra piece of information I found : 

     

    sh-4.2$ cat Probe-backend-pvd.log                                                                                                                
    2018/03/21 13:44:02:349+00:00 - info: ProbeName Detection choosing the name: backend-pvd                                                         
    2018/03/21 13:44:02:499+00:00 - info: Loading cluster probe                                                                                      
    2018/03/21 13:44:02:499+00:00 - info: cluster probe: master                                                                                      
    2018/03/21 13:44:02:518+00:00 - info: System health monitoring module missing, install a compiler and rebuild 'ca-apm-probe' package             
    2018/03/21 13:44:02:623+00:00 - info: Noticed module: fs                                                                                         
    2018/03/21 13:44:03:627+00:00 - info: Noticed module: express                                                                                    
    2018/03/21 13:44:03:630+00:00 - info: Express 4.x Routing Mechanism                                                                              
    2018/03/21 13:44:03:630+00:00 - info: Loading Express probe                                                                                      
    2018/03/21 13:44:03:633+00:00 - info: Probe express can be controlled by PBD                                                                     
    2018/03/21 13:44:17:553+00:00 - info: Noticed module: cluster         


  • 10.  Re: Does ca-apm-probe have typescript support?

    Posted 03-22-2018 01:32 PM

    Hi DanJSBR,

    To narrow down the problem, can you please provide further information

    • did you use Code-Change option (updating app.ts with code snippet) or No-Code-Change option (‘ca-apm-run’ command) to configure apm probe?
    • What is Docker command to start node application

     

    thanks

     



  • 11.  Re: Does ca-apm-probe have typescript support?

    Posted 03-22-2018 03:12 PM

    Hi sinka08.

     

    My app has both ways of starting the app, the code-change option and the no code change option.

     

    Depending on docker container variables, we start using EXEC NPM START

    or EXEC CA-APM-RUN.

     

    • With CA-APM-RUN, the application fails to boot.
    • Without variables, the NPM start is executed

     

    I tried having the no-code-change executed, and the probe.start() method and both did not work.

     

    One of the questions I have is, how should I know/find out what is the URL HOST and port for the probe.start syntax. When using the no code change option, it ends up binding to a container in docker, but with the following errors:

     

    -rw-r--r--. 1 nodejs nodejs 697 Mar 21 19:03 Probe-backend-pvd.log                                                                                           
    sh-4.2$ cat Probe-backend-pvd.log                                                                                                                            
    2018/03/21 19:01:22:805+00:00 - info: ProbeName Detection choosing the name: backend-pvd                                                                     
    2018/03/21 19:01:22:857+00:00 - info: Loading cluster probe                                                                                                  
    2018/03/21 19:01:22:857+00:00 - info: cluster probe: master                                                                                                  
    2018/03/21 19:01:22:913+00:00 - info: Noticed module: fs                                                                                                     
    2018/03/21 19:01:23:683+00:00 - info: Noticed module: express                                                                                                
    2018/03/21 19:01:23:684+00:00 - info: Express 4.x Routing Mechanism                                                                                          
    2018/03/21 19:01:23:684+00:00 - info: Loading Express probe                                                                                                  
    2018/03/21 19:01:23:685+00:00 - info: Probe express can be controlled by PBD                                                                                 
    2018/03/21 19:01:37:878+00:00 - info: Noticed module: cluster                                                                                                
    2018/03/21 19:03:35:237+00:00 - info: [Command Conn Error]Error: connect ETIMEDOUT 10.123.254.17:5005                

     

    Heres the script that we use : 

     

    #!/bin/bash


    function nodejscollector_find(){

    regex_appName='^[A-Za-z0-9]*$'
    string="$NODEJSCOLLECTOR"
    if [[ $string =~ $regex_appName ]]
    then
    echo "Internal nodejscollector"
    return 1
    else
    echo "External nodejscollector"
    return 0
    fi

    }

    echo "========================================="
    echo "Starting application"
    echo "========================================="
    env | sort

    #### I have to validate if ARTIFACT_URL is available

    if [ -n "$ARTIFACT_URL" ]
    then
    file=`basename "$ARTIFACT_URL"`
    wget -q --no-check-certificate --connect-timeout=5 --read-timeout=10 --tries=2 -O "/tmp/$file" "$ARTIFACT_URL"

    #### I have to unpackage the file to $APP_HOME

    if [ $? -eq 0 ]
    then

    if [[ $ARTIFACT_URL = *.tar* ]]
    then
    tar -xzvf /tmp/$file -C "$APP_HOME" --strip-components=1
    fi
    if [[ $ARTIFACT_URL = *.tgz* ]]
    then
    tar -xzvf /tmp/$file -C "$APP_HOME" --strip-components=1
    fi
    if [[ $ARTIFACT_URL = *.zip* ]]
    then
    unzip -o /tmp/$file -d "$APP_HOME"
    fi
    else
    echo "ERROR: while Downloading file from $ARTIFACT_URL"
    return 1
    fi
    fi

    if [ -n $NODE_PATH ]
    then
    APP_HOME="$APP_HOME/$NODE_PATH"
    fi

    pushd $APP_HOME

    if [ ! -d "node_modules" ]
    then
    if [ -n "$NPM_REGISTRY" ]
    then
    npm config set strict-ssl false
    npm config set registry $NPM_REGISTRY
    fi
    if [ -n "$NPM_LOGLEVEL" ]
    then
    npm config set loglevel $NPM_LOGLEVEL
    fi

    npm i
    fi

    echo "Copiando modulos do prometheus"
    cp -r $IMAGE_SCRIPTS_HOME/express-prom-bundle $APP_HOME/node_modules

    echo "Configurando chamada ao prometheus"
    echo '' >> $APP_HOME/app.js
    echo 'var promBundle = require("express-prom-bundle");' >> $APP_HOME/app.js
    echo '' >> $APP_HOME/app.js
    echo 'app.use(promBundle({' >> $APP_HOME/app.js
    echo ' prefix: "prometheus:fecbackend"' >> $APP_HOME/app.js
    echo '}));' >> $APP_HOME/app.js

    QUALIFIED_HOST_NAME="${PROJECT_NAME}-$HOSTNAME"
    if [ -n "${REGION}" ]
    then
    QUALIFIED_HOST_NAME="$QUALIFIED_HOST_NAME-${REGION}"
    fi
    QUALIFIED_APP_NAME="${APP_NAME}"
    if [ -n "$NODEJSCOLLECTOR" ]
    then

    if nodejscollector_find; then

    export COLLECTOR_AGENT_HOST=$(echo ${NODEJSCOLLECTOR} | awk -F':' '{print $1}')
    export COLLECTOR_AGENT_PORT=$(echo ${NODEJSCOLLECTOR} | awk -F':' '{print $2}')
    if [ -n "${JENKINS_BUILD_ID}" ]
    then
    QUALIFIED_APP_NAME="$QUALIFIED_APP_NAME-${JENKINS_BUILD_ID}"
    fi
    if [ -n "${JENKINS_JOB_NAME}" ]
    then
    QUALIFIED_APP_NAME="$QUALIFIED_APP_NAME-${JENKINS_JOB_NAME}"
    fi

    export CA_APM_PROBENAME=$QUALIFIED_APP_NAME"_devops"
    #export CA_APM_PROBENAME=${POD_NAME}
    export CA_APM_HOSTNAME=$QUALIFIED_HOST_NAME
    echo "External NodejsCollector. Will send metrics to $COLLECTOR_AGENT_HOST:$COLLECTOR_AGENT_PORT with appName ${APP_NAME}"
    exec ca-apm-run .
    else

    export COLLECTOR_AGENT_HOST=$(env | grep -i ${NODEJSCOLLECTOR}_PORT_5005_TCP_ADDR | awk -F'=' '{print $2}')
    export COLLECTOR_AGENT_PORT=$(env | grep -i ${NODEJSCOLLECTOR}_PORT_5005_TCP_PORT | awk -F'=' '{print $2}')
    if [ -n "${JENKINS_BUILD_ID}" ]
    then
    QUALIFIED_APP_NAME="$QUALIFIED_APP_NAME-${JENKINS_BUILD_ID}"
    fi
    if [ -n "${JENKINS_JOB_NAME}" ]
    then
    QUALIFIED_APP_NAME="$QUALIFIED_APP_NAME-${JENKINS_JOB_NAME}"
    fi

    export CA_APM_PROBENAME=$QUALIFIED_APP_NAME"_devops"
    #export CA_APM_PROBENAME=${POD_NAME}
    export CA_APM_HOSTNAME=$QUALIFIED_HOST_NAME
    echo "Internal NodejsCollector. Will send metrics to $COLLECTOR_AGENT_HOST:$COLLECTOR_AGENT_PORT with appName ${APP_NAME}"
    exec ca-apm-run .

    fi

    else

    echo "NodejsCollector not defined. Will not send metrics to APM."
    exec npm start

    fi




  • 12.  Re: Does ca-apm-probe have typescript support?

    Posted 03-23-2018 12:07 AM

    ca-apm-run is expected to fail in this case because it supports running nodejs app startup script (.js/.json/.node).

    > ca-apm-run <startup_script>

    It won't work with along with ts-node (ca-apm-run ts-node app.ts)

     

    "One of the questions I have is, how should I know/find out what is the URL HOST and port for the probe.start syntax."

    i assume you have CollectorAgent/InfrastructureAgent running on some other machine and you want to know how to pass that information for probe.start() option.

     

    Set environment variables COLLECTOR_AGENT_HOST, COLLECTOR_AGENT_PORT etc.. as you had set for ca-apm-run option. And then in probe.start() do not pass any argument.

     

    import * as probe from 'ca-apm-probe';

    probe.start(); // let probe use collector url from environment variables

     

    Hope it helps.



  • 13.  Re: Does ca-apm-probe have typescript support?

    Posted 03-26-2018 07:01 PM

    Hi DanJSBR, did sinka08's last reply help?



  • 14.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 04:35 PM

    Sort of did, now I am getting these messages on the logs: 

     

    Is port 15001 the correct port, or is this something else?

     

    018/04/04 20:15:57:502+00:00 - warn: Probe has disabled runtime metrics reporting because it could not validate Collector Agent version. Please check probe
    compatibility guide.
    2018/04/04 20:15:58:515+00:00 - info: Command connection established with collector agent listening on host: 180.239.92.165, port: 15001
    2018/04/04 20:15:58:519+00:00 - info: Data connection established with collector agent
    2018/04/04 20:15:59:507+00:00 - warn: Probe has disabled runtime metrics reporting because it could not validate Collector Agent version. Please check probe
    compatibility guide.
    2018/04/04 20:16:00:516+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/04 20:16:01:510+00:00 - warn: Probe has disabled runtime metrics reporting because it could not validate Collector Agent version. Please check probe
    compatibility guide.
    2018/04/04 20:16:02:518+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/04 20:16:03:515+00:00 - warn: Probe has disabled runtime metrics reporting because it could not validate Collector Agent version. Please check probe
    compatibility guide.
    2018/04/04 20:16:04:519+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/04 20:16:06:519+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/04 20:16:08:520+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/04 20:16:10:521+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/04 20:16:12:564+00:00 - info: Start Trace cannot be initiated since the command connection is down.
    2018/04/04 20:16:12:569+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.



  • 15.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 06:54 PM

    additional logs: 

     

    2018/04/04 22:52:07:278+00:00 - info: Loading Express probe
    2018/04/04 22:52:07:291+00:00 - info: Probe express can be controlled by PBD
    2018/04/04 22:52:32:325+00:00 - info: Noticed module: cluster
    2018/04/04 22:52:32:499+00:00 - info: Command connection established with collector agent listening on host: 180.239.92.159, port: 15001
    2018/04/04 22:52:32:568+00:00 - info: Command connection disconnected
    2018/04/04 22:52:32:569+00:00 - info: Data connection established with collector agent
    2018/04/04 22:52:32:577+00:00 - info: Server data on Data Conn:
    2018/04/04 22:52:32:578+00:00 - info: Data connection disconnected
    2018/04/04 22:52:32:579+00:00 - info: Data connection Closed
    2018/04/04 22:52:32:664+00:00 - info: Start Trace cannot be initiated since the command connection is down.
    2018/04/04 22:52:34:576+00:00 - info: Command connection established with collector agent listening on host: 180.239.92.159, port: 15001
    2018/04/04 22:52:34:581+00:00 - info: Command connection disconnected
    2018/04/04 22:52:34:582+00:00 - info: Command connection Closed
    2018/04/04 22:52:34:585+00:00 - info: Data connection re-established with collector agent
    2018/04/04 22:52:34:590+00:00 - info: Server data on Data Conn:
    2018/04/04 22:52:34:590+00:00 - info: Data connection disconnected
    2018/04/04 22:52:34:590+00:00 - info: Data connection Closed
    2018/04/04 22:52:36:584+00:00 - info: Command connection established with collector agent listening on host: 180.239.92.159, port: 15001
    2018/04/04 22:52:36:587+00:00 - info: Data connection established with collector agent
    2018/04/04 22:52:36:591+00:00 - info: Data Connection not re-established since Command Connection is down
    2018/04/04 22:52:36:649+00:00 - info: Server data on Data Conn:
    2018/04/04 22:52:36:650+00:00 - info: Data connection disconnected
    2018/04/04 22:52:36:650+00:00 - info: Data connection Closed



  • 16.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 07:58 PM

    2018/04/04 20:54:38:359-03:00 - info: Command connection established with collector agent listening on host: 180.239.92.165, port: 15001
    2018/04/04 20:54:38:374-03:00 - debug: App Name Detection choosing the name: app.ts
    2018/04/04 20:54:38:477-03:00 - debug: raw data received from collector: 
    2018/04/04 20:54:38:493-03:00 - info: [Command Conn Error]Error: read ECONNRESET
    2018/04/04 20:54:38:493-03:00 - info: Data connection established with collector agent
    2018/04/04 20:54:38:603-03:00 - info: Server data on Data Conn: 
    2018/04/04 20:54:38:603-03:00 - info: [Data Conn Error]Error: read ECONNRESET
    2018/04/04 20:54:38:603-03:00 - info: Data connection Closed
    2018/04/04 20:54:39:266-03:00 - debug: Cannot send require event as command connection is down.
    2018/04/04 20:54:39:282-03:00 - debug: Cannot send require event as command connection is down.
    2018/04/04 20:54:39:383-03:00 - debug: httpclient.request - no context
    2018/04/04 20:54:39:446-03:00 - debug: Error: No context
    at caHTTPClientReqHook (C:\Projects\backend-portalvendas\node_modules\ca-apm-probe\lib\probes\http.js:387:25)
    at Object.eval [as forward] (eval at recompile (C:\Projects\backend-portalvendas\node_modules\ca-apm-probe\lib\proxy.js:279:15), <anonymous>:5:7)
    at eval (eval at wrap (C:\Projects\backend-portalvendas\node_modules\ca-apm-probe\lib\proxy.js:218:20), <anonymous>:7:19)
    at Namespace.run (C:\Projects\backend-portalvendas\node_modules\continuation-local-storage\context.js:48:5)
    at ClientRequest.eval [as end] (eval at wrap (C:\Projects\backend-portalvendas\node_modules\ca-apm-probe\lib\proxy.js:218:20), <anonymous>:6:19)
    at C:\Projects\backend-portalvendas\node_modules\node-fetch\index.js:251:8
    at new WrappedPromise (C:\Projects\backend-portalvendas\node_modules\async-listener\es6-wrapped-promise.js:13:18)
    at new Fetch (C:\Projects\backend-portalvendas\node_modules\node-fetch\index.js:49:9)
    at Function.Fetch [as default] (C:\Projects\backend-portalvendas\node_modules\node-fetch\index.js:37:10)
    at BackendHubConnector.BaseHubConnector.doFetch (C:\Projects\backend-portalvendas\src\hub\connector\base-hub-connector.ts:43:36)
    at DeferSubscriber.factory (C:\Projects\backend-portalvendas\src\hub\connector\base-hub-connector.ts:65:83)
    at DeferSubscriber._callFactory (C:\Projects\backend-portalvendas\node_modules\rxjs\src\observable\DeferObservable.ts:89:25)
    at DeferSubscriber.tryDefer (C:\Projects\backend-portalvendas\node_modules\rxjs\src\observable\DeferObservable.ts:82:12)
    at new DeferSubscriber (C:\Projects\backend-portalvendas\node_modules\rxjs\src\observable\DeferObservable.ts:77:10)
    at DeferObservable._subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\observable\DeferObservable.ts:69:12)
    at DeferObservable.Observable._trySubscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:216:19)
    at DeferObservable.Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:201:59)
    at DoOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\do.ts:67:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at RetryOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\retry.ts:32:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at CatchOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\catch.ts:80:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at MergeMapOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\mergeMap.ts:89:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at MapOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\map.ts:50:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at CatchOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\catch.ts:80:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at Object.subscribeToResult (C:\Projects\backend-portalvendas\node_modules\rxjs\src\util\subscribeToResult.ts:33:21)
    at MergeMapSubscriber._innerSub (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\mergeMap.ts:135:14)
    at MergeMapSubscriber._tryNext (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\mergeMap.ts:131:10)
    at MergeMapSubscriber._next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\mergeMap.ts:115:12)
    at MergeMapSubscriber.Subscriber.next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Subscriber.ts:95:12)
    at SwitchMapSubscriber.notifyNext (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\switchMap.ts:136:24)
    at InnerSubscriber._next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Subscriber.ts:95:12)
    at MergeAllSubscriber.OuterSubscriber.notifyNext (C:\Projects\backend-portalvendas\node_modules\rxjs\src\OuterSubscriber.ts:13:22)
    at InnerSubscriber._next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\InnerSubscriber.ts:17:17)
    at InnerSubscriber.Subscriber.next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Subscriber.ts:95:12)
    at Object.subscribeToResult (C:\Projects\backend-portalvendas\node_modules\rxjs\src\util\subscribeToResult.ts:29:19)
    at MergeAllSubscriber._next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\mergeAll.ts:86:16)
    at MergeAllSubscriber.Subscriber.next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Subscriber.ts:95:12)
    at ArrayObservable._subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\observable\ArrayObservable.ts:124:20)
    at ArrayObservable.Observable._trySubscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:216:19)
    at ArrayObservable.Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:201:59)
    at MergeAllOperator.call (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\mergeAll.ts:65:19)
    at Observable.subscribe (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Observable.ts:199:16)
    at Object.subscribeToResult (C:\Projects\backend-portalvendas\node_modules\rxjs\src\util\subscribeToResult.ts:33:21)
    at SwitchMapSubscriber._innerSub (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\switchMap.ts:108:39)
    at SwitchMapSubscriber._next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\operator\switchMap.ts:100:10)
    at SwitchMapSubscriber.Subscriber.next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Subscriber.ts:95:12)
    at Subject.next (C:\Projects\backend-portalvendas\node_modules\rxjs\src\Subject.ts:61:17)
    at C:\Projects\backend-portalvendas\src\jobs\update-movements.job.ts:39:33
    at tryCatcher (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\promise.js:693:18)
    at Async._drainQueue (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Projects\backend-portalvendas\node_modules\knex\node_modules\bluebird\js\release\async.js:17:14)
    at Immediate.<anonymous> (C:\Projects\backend-portalvendas\node_modules\async-listener\glue.js:188:31)
    at runCallback (timers.js:672:20)
    at tryOnImmediate (timers.js:645:5)
    at processImmediate [as _immediateCallback] (timers.js:617:5)
    2018/04/04 20:54:39:446-03:00 - debug: start: fragment.NoContext[10 101 1000] - ts:1522886079446



  • 17.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 09:44 PM

    Hi DanJSBR,

    default port for apmia/collector agent is 5005. I assume you did not update port in profile for apmia/CollectorAgent running on machine 180.239.92.165.

     

    have you installed collector agent or apmia? which version of APM.

     

    thanks



  • 18.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 10:42 PM

    In our environment, the port is configured as 15001. I am able to see the agent pop up in the workstation website, however no metrics are sent and I keep getting the following error in the node module log:

     

    warn: Probe has disabled runtime metrics reporting because it could not validate Collector Agent version. Please check probe 
    compatibility guide.                   
    I have the version of my npm ppackage> 
    "ca-apm-probe": "^1.10.54",


  • 19.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 10:58 PM

    what is running on 15001? collector agent or apm ia? if apmia, have you enabled nodejs extension?

    do you see errors in collectoragent/apm logs.

     

    looks like probe to collector agent connection is getting established and then dropped



  • 20.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:14 PM

    4/05/18 12:10:17 AM BRT [INFO] [CollectorAgent] Introscope Collector Agent Release 10.5.1.6 (Build 990006)
    4/05/18 12:10:17 AM BRT [INFO] [CollectorAgent] Using Java VM version "Java HotSpot(TM) 64-Bit Server VM 1.8.0_25" from Oracle Corporation
    4/05/18 12:10:17 AM BRT [INFO] [CollectorAgent] Using Introscope installation at: /opt/wily/CollectorAgent-10.5.1_unix/.
    4/05/18 12:10:17 AM BRT [INFO] [CollectorAgent] CA Wily Introscope(R) Version 10.5.1

    Connected controllable Agent to the Introscope Enterprise Manager at 180.239.92.165:15001

     

    We use the agent that binds to the introscope Manager URL.

    The CollectorAgent you see is in docker, should I bind my resource to that collectorAgent IP and port 5005?



  • 21.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:20 PM

    2018/04/05 03:16:27:86+00:00 - info: ProbeName Detection choosing the name: PVD-DEV-BACKEND
    2018/04/05 03:16:27:135+00:00 - info: Loading cluster probe
    2018/04/05 03:16:27:135+00:00 - info: cluster probe: master
    2018/04/05 03:16:28:546+00:00 - info: Noticed module: fs
    2018/04/05 03:16:31:378+00:00 - info: Noticed module: http
    2018/04/05 03:16:31:389+00:00 - info: Probe http can be controlled by PBD
    2018/04/05 03:16:31:395+00:00 - info: Noticed module: https
    2018/04/05 03:16:31:397+00:00 - info: Probe https can be controlled by PBD
    2018/04/05 03:17:59:67+00:00 - info: Noticed module: express
    2018/04/05 03:17:59:69+00:00 - info: Express 4.x Routing Mechanism
    2018/04/05 03:17:59:69+00:00 - info: Loading Express probe
    2018/04/05 03:17:59:70+00:00 - info: Probe express can be controlled by PBD
    2018/04/05 03:18:16:229+00:00 - info: Noticed module: cluster
    2018/04/05 03:18:16:325+00:00 - info: Command connection established with collector agent listening on host: 10.117.10.190, port: 5005
    2018/04/05 03:18:16:357+00:00 - info: Data connection established with collector agent
    2018/04/05 03:18:21:326+00:00 - warn: Probe has disabled runtime metrics reporting because it could not validate Collector Agent version. Please check probe compatibility guide.

    Even with the 5005 bind (Which looks like it works), the probe disables metrics.



  • 22.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:22 PM

    Also logs from the collector agent docker: 

     


    4/05/18 12:18:16 AM BRT [INFO] [IntroscopeAgent.ArfTransport] New tcp ARF command connection: {"op":"commandConn","probe":"nodejs","ver":"1.1.0","instid":"backend-461-b1t3x-624","pgm":"PVD-DEV-BACKEND","prms":{"appName":"app.ts","hostName":null}}
    4/05/18 12:18:16 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] AutoTracingTriggerServiceBean activated.
    4/05/18 12:18:16 AM BRT [INFO] [IntroscopeAgent.ArfTransport] TCP connction attempt from port 55800
    4/05/18 12:18:16 AM BRT [INFO] [IntroscopeAgent.ArfTransport] New tcp ARF data connection: {"op":"dataConn","probe":"nodejs","ver":"1.1.0","pid":624,"instid":"backend-461-b1t3x-624"}
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (introscope.agent.crossprocess.sequenceid.maxlimit) set to default value of "32"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (introscope.agent.crossprocess.compression) set to default value of "lzma"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (introscope.agent.crossprocess.compression.minlimit) set to default value of "1024"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (introscope.agent.crossprocess.correlationid.maxlimit) set to default value of "2048"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (wily.VirtualStackCursor.maxDecorations) set to default value of "5000"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (wily.TransactionCache.maxDBConnections) set to default value of "100"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (wily.TransactionCache.maxCallerHasSeenStackElements) set to default value of "20"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (wily.TransactionCache.maxInvocationDatasFromWebServices) set to default value of "20"
    4/05/18 12:18:17 AM BRT [INFO] [IntroscopeAgent.CollectorAgent Agent] Configuration property (introscope.agent.errorsnapshots.throttle) set to "10"



  • 23.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:34 PM

    It has disabled runtime metrics i.e event loop ticks per interval, heap, and few others. see full list here Node.js Application Monitoring - CA Application Performance Management - 10.5 - CA Technologies Documentation 

     

    However,  you will still see application component metrics - http frotend, http backend, mysql and others supported for monitoring.

     

    Reason for disabling - ca-apm-probe@1.10.54 is not fully compatible with Collector Agent version 10.5.1

    Possible solutions - Either upgrade collector agent version >= 10.5.2 Or install ca-apm-probe@1.10.32



  • 24.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:54 PM

    Downgraded the npm package version to 1.10.32

    It kinda works @sinka08, but connection gets dropped :

     

    4/05/18 12:49:08 AM BRT [INFO] [IntroscopeAgent.ArfConnection] End of ARF connection: TcpArfDataConnection type:nodejs instance: backend-461-b1t3x-624 port:55800
    4/05/18 12:49:08 AM BRT [INFO] [IntroscopeAgent.ArfConnection] End of ARF connection: TcpArfCommandConnection program:PVD-DEV-BACKEND type:nodejs instance: backend-461-b1t3x-624 port:55772
    4/05/18 12:49:08 AM BRT [INFO] [IntroscopeAgent.ArfConnection] Closing ARF connection: TcpArfDataConnection type:nodejs instance: backend-461-b1t3x-624 port:55800
    4/05/18 12:49:08 AM BRT [INFO] [IntroscopeAgent.ArfConnection] Closing ARF connection: TcpArfCommandConnection program:PVD-DEV-BACKEND type:nodejs instance: backend-461-b1t3x-624 port:55772
    4/05/18 12:49:08 AM BRT [INFO] [IntroscopeAgent.ProbeCollector] Data Connection from pid(624) for nodejs(backend-461-b1t3x-624) has been reset.
    4/05/18 12:49:08 AM BRT [INFO] [IntroscopeAgent.ProbeCollector] Command Connection from PVD-DEV-BACKEND for nodejs(backend-461-b1t3x-624) has been reset.

    2018/04/05 03:49:24:299+00:00 - info: ProbeName Detection choosing the name: PVD-DEV-BACKEND
    2018/04/05 03:49:24:429+00:00 - info: Loading cluster probe
    2018/04/05 03:49:24:430+00:00 - info: cluster probe: master
    2018/04/05 03:49:26:282+00:00 - info: Noticed module: fs
    2018/04/05 03:49:30:225+00:00 - info: Noticed module: http
    2018/04/05 03:49:30:237+00:00 - info: Probe http can be controlled by PBD
    2018/04/05 03:49:30:249+00:00 - info: Noticed module: https
    2018/04/05 03:49:30:251+00:00 - info: Probe https can be controlled by PBD
    2018/04/05 03:51:35:675+00:00 - info: Noticed module: express
    2018/04/05 03:51:35:697+00:00 - info: Express 4.x Routing Mechanism
    2018/04/05 03:51:35:697+00:00 - info: Loading Express probe
    2018/04/05 03:51:35:700+00:00 - info: Probe express can be controlled by PBD
    2018/04/05 03:51:59:208+00:00 - info: Noticed module: cluster
    2018/04/05 03:51:59:331+00:00 - info: Command connection established with collector agent listening on host: 10.117.10.190, port: 5005
    2018/04/05 03:51:59:361+00:00 - info: Data connection established with collector agent
    2018/04/05 03:52:01:336+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/05 03:52:03:342+00:00 - info: Timeout for Speak Message. Closing Command and Data Connections from Probe End.
    2018/04/05 03:52:04:377+00:00 - info: Data connection disconnected
    2018/04/05 03:52:04:377+00:00 - info: Data connection Closed
    2018/04/05 03:52:04:382+00:00 - info: Command connection disconnected
    2018/04/05 03:52:06:379+00:00 - info: Data Connection not re-established since Command Connection is down
    2018/04/05 03:52:06:401+00:00 - info: Command connection established with collector agent listening on host: 10.117.10.190, port: 5005
    2018/04/05 03:52:06:404+00:00 - info: Data connection established with collector agent



  • 25.  Re: Does ca-apm-probe have typescript support?

    Posted 04-05-2018 12:00 AM

    From curl in the nodejscollector docker I get this: 

     

    sh-4.2$ curl -v 180.239.92.165:15001
    * About to connect() to 180.239.92.165 port 15001 (#0)
    * Trying 180.239.92.165...
    * Connected to 180.239.92.165 (180.239.92.165) port 15001 (#0)
    > GET / HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: 180.239.92.165:15001
    > Accept: */*
    >
    * Recv failure: Connection reset by peer
    * Closing connection 0
    curl: (56) Recv failure: Connection reset by peer



  • 26.  Re: Does ca-apm-probe have typescript support?

    Posted 04-05-2018 12:50 AM

    weird. does it keep connecting disconnecting?

    1.set following property in CollectorAgent\core\config\IntroscopeCollectorAgent.profile

    log4j.logger.IntroscopeAgent.ProbeCollector=TRACE#com.wily.util.feedback.Log4JSeverityLevel, console, logfile

     

    2.restart collector agent

    3.share collector agent logs



  • 27.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:22 PM

    yes. pass collector agent host port to ca-apm-probe.

    this is how communication happens

    probe --> collector agent --> enterprise manager



  • 28.  Re: Does ca-apm-probe have typescript support?

    Posted 04-04-2018 11:27 PM

    the last logs I pasted are from that communication method...can u take a look? sinka08



  • 29.  Re: Does ca-apm-probe have typescript support?

    Posted 04-09-2018 02:21 PM

    sinka08 after a hard fought battle, it has worked!

     

    Thanks everyone for the help.



  • 30.  Re: Does ca-apm-probe have typescript support?

    Posted 04-09-2018 04:14 PM

    great !!



  • 31.  Re: Does ca-apm-probe have typescript support?

    Posted 04-09-2018 10:06 PM

    Hi DanJSBR that is awesome! Would you mind sharing what are the steps you've taken to make this work, so that others in this community can benefit from it too?



  • 32.  Re: Does ca-apm-probe have typescript support?

    Posted 03-20-2018 06:36 PM

    Also, using typescrit 2.4.2, the import will complain because there are no typing definitions being exported by your module, so I would need either to have @types/ca-apm-probe created or a custom type in my typings.d.ts