我试着跟随在New Relic的文档https://docs.newrelic.com/docs/dotnet/dotnet-agent-custom-metrics对我们的Web应用程序设置自定义指标,但不能让它开始工作。
在New Relic的跟踪,我们看到很多的
应用程序代码(在System.Web.Mvc.MvcHandler.BeginProcessRequest()) -我们的代理无法看到什么是在你的.NET代码发生。 咨询我们的文档,以了解如何定义指标添加到您的应用程序。
所以,我创建了一个MyInstrumentation.xml文件,把它的扩展文件夹,我仍然没有看到任何其他指标。 我究竟做错了什么?
这里是我的自定义指标示例XML:
<?xml version="1.0" encoding="utf-8"?>
<extension xmlns="urn:newrelic-extension">
<instrumentation>
<tracerFactory>
<match assemblyName="WebSite.Area" className="WebSite.Area.Controllers.MyController">
<exactMethodMatcher methodName="MyMethod" />
</match>
</tracerFactory>
<tracerFactory>
<match assemblyName="Business.CustomerBL" className="Business.CustomerBL.MyBusinessClass">
<exactMethodMatcher methodName="SaveCustomer" />
</match>
</tracerFactory>
</instrumentation>
</extension>