SkyAPM-nodejs icon indicating copy to clipboard operation
SkyAPM-nodejs copied to clipboard

Close agent when server returns PERMISSION_DENIED

Open Saicasm opened this issue 4 years ago • 3 comments

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 ?

Saicasm avatar Feb 04 '21 08:02 Saicasm

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

wu-sheng avatar Feb 04 '21 09:02 wu-sheng

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

Saicasm avatar Feb 04 '21 09:02 Saicasm

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.

wu-sheng avatar Feb 04 '21 13:02 wu-sheng