This is a gRPC server used to test our infinite tracing with the Node.js agent.
To setup gRPC, run
npm install
node index.js
Once the gPRC server is started, you can use it in an example application and set the following in newrelic.js
exports.config = {
license_key: <your-license-key>,
infinite_tracing: {
trace_observer: {
host: 'localhost',
port: 50051,
insecure: true
},
span_events: {
force_capture_trace: true
}
}
}
As you use the application the mock gPRC server will log to console the number of spans seen.
You can have the mock server respond with an error every n calls. The agent has client retries built in and this can verify it is working. Below is an example that fails every 10th call:
NR_FAILS=true NR_FAIL_N_CALLS=10 node index.js