admin管理员组

文章数量:1426338

I have a application with the apm enabled and the unique reference to the apm sdk is on the package.json dependencies and at the app.js. whose i have the line below:

const apm = require('elastic-apm-node').start()

The constant 'apm' does not utilized at nowhere.

I want to remove the apm because in my local environment i receive the below messages:

APM Server transport error (503): Unexpected APM Server response
queue is full

I have a application with the apm enabled and the unique reference to the apm sdk is on the package.json dependencies and at the app.js. whose i have the line below:

const apm = require('elastic-apm-node').start()

The constant 'apm' does not utilized at nowhere.

I want to remove the apm because in my local environment i receive the below messages:

APM Server transport error (503): Unexpected APM Server response
queue is full
Share Improve this question asked Jul 18, 2019 at 16:01 Marcel BezerraMarcel Bezerra 1791 silver badge9 bronze badges 4
  • Have you tried setting the ELASTIC_APM_ACTIVE env var to false? Refer to elastic.co/guide/en/apm/agent/nodejs/master/… – mrkre Commented Jul 19, 2019 at 6:10
  • It works! But now it is not showing the error messages on the console. How do i it? – Marcel Bezerra Commented Jul 30, 2019 at 13:59
  • There's also ELASTIC_APM_LOG_LEVEL where you can set to info as a start. elastic.co/guide/en/apm/agent/nodejs/master/… – mrkre Commented Jul 31, 2019 at 6:17
  • Perfect. It works. Thank you @mrkre. – Marcel Bezerra Commented Jul 31, 2019 at 16:59
Add a ment  | 

2 Answers 2

Reset to default 2

You can set the environment variable ELASTIC_APM_ACTIVE to false.

Refer to https://www.elastic.co/guide/en/apm/agent/nodejs/master/configuration.html#active.

At the start of the server.js add the following code and for production, you can export NODE_ENV to production

require("elastic-apm-node").start({
    serviceName: "AppName",
    secretToken: "",
    serverUrl: "URL",
    captureBody: "errors",
    active: process.env.NODE_ENV === "production"
});

本文标签: javascriptHow disable the apm on DEV enviromentStack Overflow