我正在尝试为我的Nodejs应用程序设置新的遗迹,我添加了
newrelic.js
在我回购的根源上,导入
newrelic
在第一行并使用
"newrelic": "9.15.0"
,我可以在新遗迹面板上看到应用程序指标,但我无法在新遗迹上看到任何日志,如果我设置env变量
NEW_RELIC_NO_CONFIG_FILE=true
然后我可以看到日志。
newrelic.js
{
agent_enabled: process.env.NODE_ENV === "prod",
app_name: ["Demo-Service"],
license_key: "my key",
logging: {
enabled: true,
level: "info",
},
allow_all_headers: true,
ignore: ["*/live", "*/ready"],
attributes: {
exclude: [
"request.headers.cookie",
"request.headers.authorization",
"request.headers.proxyAuthorization",
"request.headers.setCookie*",
"request.headers.x*",
"response.headers.cookie",
"response.headers.authorization",
"response.headers.proxyAuthorization",
"response.headers.setCookie*",
"response.headers.x*",
],
},
}
newrelic_agent.log
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.461Z","msg":"Using New Relic for Node.js. Agent version: 9.15.0; Node version: v16.19.0."}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.491Z","msg":"Using LegacyContextManager"}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.492Z","msg":"Adding destroy hook to clean up unresolved promises.","component":"async_hooks"}
{"v":0,"level":40,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.508Z","msg":"The newrelic module must be the first module required.\nThe following modules were required before newrelic and are not being instrumented:\n\tfastify: /{path}/node_modules/fastify-plugin/plugin.js\n\tmongodb: {path}/node_modules/mongodb/lib/index.js\n\taws-sdk: {path}/node_modules/aws-sdk/lib/aws.js\n\tq: {path}/node_modules/pino/pino.js"}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.508Z","msg":"Agent state changed from stopped to starting."}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.512Z","msg":"Starting New Relic for Node.js connection process."}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:36.512Z","msg":"Agent state changed from starting to connecting."}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:39.462Z","msg":"Agent state changed from connecting to connected."}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:39.462Z","msg":"Connected to collector-004.newrelic.com:443 with agent run ID {some_id_here}.","component":"collector_api"}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:39.463Z","msg":"Reporting to: https://rpm.newrelic.com/accounts/{number}/applications/{number}","component":"collector_api"}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:39.466Z","msg":"Valid event_harvest_config received. Updating harvest cycles. {\"report_period_ms\":5000,\"harvest_limits\":{\"error_event_data\":8,\"log_event_data\":833,\"analytic_event_data\":833,\"custom_event_data\":250}}"}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:39.471Z","msg":"Agent state changed from connected to started."}
{"v":0,"level":30,"name":"newrelic","hostname":"host-local","pid":18262,"time":"2023-04-18T23:19:40.472Z","msg":"Starting initial 1000ms harvest."}
我在这里错过了什么?