问题
I've tried to follow the New Relic documentation at https://docs.newrelic.com/docs/dotnet/dotnet-agent-custom-metrics for setting up custom metrics on our web application but cannot get it to work.
In the New Relic trace we see lots of
Application code (in System.Web.Mvc.MvcHandler.BeginProcessRequest()) - Our agent can't see what is happening in your .NET code. Consult our documentation to find out how to add custom metrics to your app.
So, I've created a MyInstrumentation.xml file, put it in the extensions folder and am still not seeing any additional metrics. What am I doing wrong?
Here is example XML of my custom metrics:
<?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>
回答1:
An application pool recycle was what was required
来源:https://stackoverflow.com/questions/20680249/new-relic-custom-metrics-cannot-get-it-to-work