【发布时间】:2019-07-10 08:35:37
【问题描述】:
我们在旧的新遗物版本中使用的代码中有一个 createTracer() 方法。
NR.createTracer("processThread", _ => this._initialize())();
为了将新遗物迁移到新遗物的最新版本,我已根据新遗物文档将其替换为 startSegment() 方法:https://github.com/newrelic/node-newrelic/blob/master/Migration%20Guide.md#upgrading-to-agent-v5
NR.startSegment("processThread", _ => this._initialize())();
但是现在,我的代码给了我这个错误:
TypeError: NR.startSegment(...) is not a function
我在这里做错了什么?
我看到 startSegment() 和 createTracer() 中的参数已更改 https://newrelic.github.io/node-newrelic/docs/API.html#createTracer
【问题讨论】: