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 tofalse
? 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 toinfo
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
2 Answers
Reset to default 2You 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
版权声明:本文标题:javascript - How disable the apm on DEV enviroment - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745472878a2659830.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论