SkyAPM / SkyAPM-nodejs

The NodeJS server side agent for Apache SkyWalking
Apache License 2.0
128 stars 86 forks source link

Close agent when server returns PERMISSION_DENIED #145

Open Saicasm opened 3 years ago

Saicasm commented 3 years ago

Hi , I'm passing authorisation token in meta data from the node js agent and OAP server checks if the token is valid or not and if it is not valid then it returns status PERMISSION_DENIED and node js agent infinitly sends request to the server instead of killing the agent gRPC process.

I tried this in remtoe-client-service.js file hoping it would work but the application using node js is crashing.

Screen Shot 2021-02-04 at 14 22 35

is there a way to just stop the node js agent without kill the application using it ?

wu-sheng commented 3 years ago

I think to do that, you need to support the agent running in NO_OP mode.

Saicasm commented 3 years ago

NO_OP

Hi @wu-sheng can you be more specific ? i didn't understand it , if it's possible can you post how and where the changes need to be done

wu-sheng commented 3 years ago

I don't read the go2sky codes recently, in Java, it is like this, https://github.com/apache/skywalking/blob/master/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/context/IgnoredTracerContext.java.

It doesn't generate meaningful spans and segment.