peaksnail / pinpoint-node-agent

pinpoint agent for nodejs
Apache License 2.0
75 stars 26 forks source link

Stats not receiving on collector #5

Open ViswanathSRIRAM opened 7 years ago

ViswanathSRIRAM commented 7 years ago

Hi, Thanks for your plugin. I am trying out this plugin. We are using some older version of node js. node --version v0.10.38

I have to make small code changes because of the older version. The V8 module hasnt worked. As of now I have commented the heap_max_memory = (v8.getHeapStatistics())['heap_size_limit']; and hardcoded a value in agent_stat_monitor.js. My intention is to make sure we are able to send stats from nodejs to pinpoint for now. Later I will try the V4 or V6 instead of V8.

After these changes I see the agent sending the data.. Config i left with default. and the collector running on same host. In the agent log: [2016-10-18 00:04:20.721] [DEBUG] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/commons/metric/agent_stat_monitor] send agent stat:{"agentId":"node-app-id","startTimestamp":1476761324603,"timestamp":1476763460721,"collectInterval":1000,"gc":{"type":0,"jvmMemoryHeapUsed":142946304,"jvmMemoryHeapMax":10,"jvmMemoryNonHeapUsed":0,"jvmMemoryNonHeapMax":0,"jvmGcOldCount":0,"jvmGcOldTime":0,"jvmGcDetailed":null},"cpuLoad":{"jvmCpuLoad":0.001,"systemCpuLoad":0.011827059690388815},"transaction":null,"activeTrace":null,"metadata":null} [2016-10-18 00:04:20.724] [DEBUG] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/socket/udp_client] UDP message sent to 127.0.0.1:9995, size is: 75 [2016-10-18 00:04:29.185] [INFO] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/utils/packet_util] receive control ping [2016-10-18 00:04:29.186] [INFO] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/utils/packet_util] send control pong success! [2016-10-18 00:04:29.187] [INFO] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/socket/tcp_client] message request success! [2016-10-18 00:04:30.711] [DEBUG] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/commons/metric/agent_stat_monitor] send agent stat:{"agentId":"node-app-id","startTimestamp":1476761324603,"timestamp":1476763470711,"collectInterval":1000,"gc":{"type":0,"jvmMemoryHeapUsed":142983168,"jvmMemoryHeapMax":10,"jvmMemoryNonHeapUsed":0,"jvmMemoryNonHeapMax":0,"jvmGcOldCount":0,"jvmGcOldTime":0,"jvmGcDetailed":null},"cpuLoad":{"jvmCpuLoad":0.001,"systemCpuLoad":0.011827068880386687},"transaction":null,"activeTrace":null,"metadata":null} [2016-10-18 00:04:30.712] [DEBUG] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/socket/udp_client] UDP message sent to 127.0.0.1:9995, size is: 75

But i dont see any logs in collector nor I dont see any data showing up in WebUI. i just got the application name alone in UI. I dont find any errors either in the logs. Can you please let me know if any config has to be done on the collector end. I am having the code from master branch of actual pinpoint for Web and Collector. I have built the package as 1.6 and setup.

peaksnail commented 7 years ago

1 make sure the collector has the following logs: 10-18 20:55:50 [DEBUG](c.n.p.c.h.AgentStatHandler :44) tbase is a TAgentStat ,Received AgentStats=TAgentStat(agentId:angelia-portal-agent, startTimestamp:1476026057455, timestamp:1476795350673, collectInterval:1000, gc:TJvmGc(type:UNKNOWN, jvmMemoryHeapUsed:68419584, jvmMemoryHeapMax:1535115264, jvmMemoryNonHeapUsed:0, jvmMemoryNonHeapMax:0, jvmGcOldCount:0, jvmGcOldTime:0), cpuLoad:TCpuLoad(jvmCpuLoad:0.003, systemCpuLoad:0.06210557039803251))

2 there must be some transaction data in the web ui that you have the chance to get the stat of server like this server

By the way,because there has no relative fileds for nodejs ,so the jvmMemoryHeapUsed means the node mem used,and so on.

peaksnail commented 7 years ago

You could visit the url http://${ip}:28080/#/inspector/${application.name}@STAND_ALONE/1h/2016-10-18-21-27-05/${agent.id} Of course you can set the '2016-10-18-21-27-05' to something else when your agent is working

ViswanathSRIRAM commented 7 years ago

Hi TEam, thanks for the response. Ya. I have an idea of collector and the web. I am able to integrate the same with tomcat and its working fine. I am facing this issue with nodejs agent. I am not able to see the TAgentStat logs at the collector end for nodejs. Only tomcat I am able to see.

I dont see neither errors or collector or agent end.

Receiving ping pong success on agent. opt/nodejs/application/pinpointnodeagent/agent/utils/packet_util] send control pong success! [2016-10-18 00:04:29.187] [INFO] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/socket/tcp_client] message request success! [2016-10-18 00:04:30.711] [DEBUG] [node-app-name]

And the UDP stats like below : [opt/nodejs/application/pinpointnodeagent/agent/commons/metric/agent_stat_monitor] send agent stat:{"agentId":"node-app-id","startTimestamp":1476761324603,"timestamp":1476763470711,"collectInterval":1000,"gc":{"type":0,"jvmMemoryHeapUsed":142983168,"jvmMemoryHeapMax":10,"jvmMemoryNonHeapUsed":0,"jvmMemoryNonHeapMax":0,"jvmGcOldCount":0,"jvmGcOldTime":0,"jvmGcDetailed":null},"cpuLoad":{"jvmCpuLoad":0.001,"systemCpuLoad":0.011827068880386687},"transaction":null,"activeTrace":null,"metadata":null} [2016-10-18 00:04:30.712] [DEBUG] [node-app-name] [opt/nodejs/application/pinpointnodeagent/agent/socket/udp_client] UDP message sent to 127.0.0.1:9995, size is: 75

I am stuck here and looking for further help. Also I can contribute to your code if you are willing. As I am trying with lower version on nodeJs I faced few issues with agent and modified. I can let you know the details.

ViswanathSRIRAM commented 7 years ago

Just attaching the snapshot What i am seeing for nodejs. May be you get any idea..

screen shot 2016-10-18 at 10 04 18 am
peaksnail commented 7 years ago

I'm glad you are willing to contribute to the pinpoint node agent!

the nodejs agent has traced nothing here from your snapshot, so you can not see anything.And you can have a try to visit http://${ip}:28080/#/inspector/${application.name }@STAND_ALONE/1h/2016-10-18-21-27-05/${agent.id}

Here I want to confirm two things, One is that what method you use to start you node app, just using the native method: node app.js to start? Anothor is that could you show me your pinpoint node agent config in agent/conf/pinpoint.config

2016-10-18 22:05 GMT+08:00 ViswanathSRIRAM notifications@github.com:

Just attaching the snapshot What i am seeing for nodejs. May be you get any idea.. [image: screen shot 2016-10-18 at 10 04 18 am] https://cloud.githubusercontent.com/assets/21371966/19480945/4e2c2f82-951a-11e6-8dab-1369d7c77818.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/peaksnail/pinpoint-node-agent/issues/5#issuecomment-254517750, or mute the thread https://github.com/notifications/unsubscribe-auth/ABqe3ytVhb0Uo41ghiAAsxK_ZciEcCuSks5q1NIvgaJpZM4KZW2F .

ViswanathSRIRAM commented 7 years ago

Inspector snapshot

screen shot 2016-10-18 at 12 11 39 pm

Yes. We are using app.js to start. pinpoint.txt

Also attaching the pinpoint.config file

peaksnail commented 7 years ago

It's weird! I think i have to look up the lastest code what has changed about agent stats and build it to test.

ViswanathSRIRAM commented 7 years ago

Hi Team, Does this plugin supports transaction as well?

peaksnail commented 7 years ago

Of course, it supports transaction same with pinpoint java agent,but only support few plugins like express,redis listed in agent/plugin/core,and you can develop your own plugin in guide

peaksnail commented 7 years ago

Hi, I have built collector and web module with the lastest code about version 1.6.0. And it's normal in my environment. I compare the lastest code with the time i finished the node agent stat monitor.I found that using AgentStatBatch is recommended.But AgentStat is supported too. Currenttly the node agent sends the AgentStat to collector and the collector will not show any receiving info.So we can not see any log about agent info in the log. But you can query table AgentStat in hbase.There will be agent stat data.

Then you may restart your pinpoint web or using the web module about version 1.5.2 to have a try? Or make the node app running for a long time and have a look?

All in all, first you should query the hbase to confirm collector has received the agent stat data. then make the app running for a long time ,and then restart the web module or install the version 1.5.2

Inspector snapshot rzb2lcow s buy g y cd55