[Net] Console application not collecting data

I’m trying to get my console app collecting data. Looking at instructions from the following two links:

https://docs.newrelic.com/docs/agents/net-agent/installation/install-net-agent-windows/
https://docs.newrelic.com/docs/agents/net-agent/custom-instrumentation/create-transactions-xml-net/
and questions here:

  • I’ve verified that the agent was installed with the ‘Instrument All’ option and machine was rebooted after.

  • This is the newrelic.config in the app directory:

<?xml version="1.0"?>
<!-- Copyright (c) 2008-2020 New Relic, Inc.  All rights reserved. -->
<!-- For more information see: https://newrelic.com/docs/dotnet/dotnet-agent-configuration -->
<configuration xmlns="urn:newrelic-config" agentEnabled="true">
  <service licenseKey="XXXXXXXXXXXXXXXXXXXXXXXXXX" />
  <application>
    <name>WebToP21Handler</name>
  </application>
  <log level="info" />
  <transactionTracer enabled="true" transactionThreshold="apdex_f" stackTraceThreshold="500" recordSql="obfuscated" explainEnabled="false" explainThreshold="500" />
  <crossApplicationTracer enabled="true" />
  <instrumentation>
    <applications>
      <application name="MsgHandlerWeb.exe" />
    </applications>
  </instrumentation>
  <errorCollector enabled="true">
    <ignoreErrors>
      <exception>System.IO.FileNotFoundException</exception>
      <exception>System.Threading.ThreadAbortException</exception>
    </ignoreErrors>
    <ignoreStatusCodes>
      <code>401</code>
      <code>404</code>
    </ignoreStatusCodes>
  </errorCollector>
  <browserMonitoring autoInstrument="true" />
  <threadProfiling>
    <ignoreMethod>System.Threading.WaitHandle:InternalWaitOne</ignoreMethod>
    <ignoreMethod>System.Threading.WaitHandle:WaitAny</ignoreMethod>
  </threadProfiling>
</configuration>

The app config also contains:

  <appSettings>
    <add key="NewRelic.AgentEnabled" value="true" />
    <add key="NewRelic.AppName" value="DataServices" />
  </appSettings>
  • I did not make any changes to the newrelic.config in C:\ProgramData\New Relic.NET Agent

  • In the extensions folder C:\ProgramData\New Relic.NET Agent\Extensions I added MsgHandlerWeb.xml

<?xml version="1.0" encoding="utf-8"?>
<extension xmlns="urn:newrelic-extension">
  <instrumentation>
    <!-- Define the method which triggers the creation of a transaction. -->
    <tracerFactory name="NewRelic.Agent.Core.Tracer.Factories.BackgroundThreadTracerFactory" metricName="WebToP21">
      <match assemblyName="MsgHandlerWeb" className="MsgHandlerWeb.Web">
        <exactMethodMatcher methodName="ProcessQueue" />
      </match>
    </tracerFactory>
    <!-- Instrument 0 or more methods called by the trigger method. These methods appear in the transaction breakdown table and in transaction traces. -->
    <tracerFactory>
      <match assemblyName="MsgHandlerWeb" className="MsgHandlerWeb.Web">
        <exactMethodMatcher methodName="ProcessOrderMessage" />
      </match>
    </tracerFactory>
  </instrumentation>
</extension>

In NR I am looking at the Transactions Monitor for Transaction Type Non-web.

Hi there,

It looks like you were able to get your application to report data to New Relic.

Please let us know if you’re still running into trouble or have questions.

Thanks!