Configuring NewRelic

Available only on Linux. WSL is not supported.

NewRelic will allow monitoring performance during development, hopefully allowing to spot performance regressions before going to prod.

You will need an infrastructure container running for the NewRelic daemon.

1. Retrieve your NR license key.

https://docs.newrelic.com/docs/apis/intro-apis/new-relic-api-keys/

2. Run the following command

It will spin up a NewRelic infra container (Note that it will run in privileged mode):

docker run \
    -d \
    --name newrelic-infra \
    --network=host \
    --cap-add=SYS_PTRACE \
    --privileged \
    --pid=host \
    -v "/:/host:ro" \
    -v "/var/run/docker.sock:/var/run/docker.sock" \
    -e NRIA_LICENSE_KEY=<LICENSE_KEY> \
    newrelic/infrastructure:latest

Replace <LICENSE_KEY> with your license key

3. Add the following configuration to your cma.js

module.exports = {
	... // other configurations
    configuration: {
        newRelic: {
            enabled: true,
            licenseKey: '<LICENSE_KEY>'
        }
    }
};

4. Run the start command without the -s option

Last updated