• /
  • EnglishEspañol日本語한국어Português
  • Log inStart now

Debugging for .NET Core on Linux

Problem

After installing New Relic's .NET agent in Linux, you don't see any data, notice missing data, or don't see any logs.

Solution

Important

  • Make sure you have administrator privileges on your host to continue
  • Ensure that the installation and execution steps have been followed (installation guide)

Step 1: Check for agent logs of the application

Tip

  • If you installed our agent for .NET Core, or installed either agent with the NewRelic.Agent NuGet package, you'll find a logs folder in the directory where the agent was extracted on your system.
  • In some installation methods in linux, it defaults to /usr/local/newrelic-dotnet-agent (agent versions 10.0.0 or higher) or /usr/local/newrelic-netcore20-agent (agent versions 9.9.0 or lower).
  1. Make sure you're looking at current data. Delete or move any existing files in the logs directory so that you're sure the logs you generate reflect the current state of your system.
  2. Restart your application.
  3. Exercise your application for at least one minute in a way that would generate traffic you’d expect to see in your New Relic account.
  4. Make note of the process ID (PID) your application is running under so you can verify if a log is being created for that process. You can find the PID by using either of the following commands via the command-line: pidof dotnet or pidof the_process_name.
  5. Go back to the agent logs directory and look for a log file with a name containing the process ID of your application, for example NewRelic.Profiler.[PID].log.
  6. If you see that profiler log file in the logs directory, then also check to see if there is a corresponding agent log.
  7. Look for another file with the prefix newrelic_agent. There may be more than one of these if you’re running multiple .NET applications on your host. If you see one or more you must determine which corresponds to the application you’re trying to monitor.
  8. Search in the agent log for the string (pid [your PID]), for example (pid 1573). If you find that string in the log file, then you know it is the agent log associated with your application.

Step 2: Check if the agent profiler is loaded into the application's process

In the console, execute the following, replacing pid with your process ID:

bash
$
sudo cat /proc/PID/maps | grep "libNewRelicProfiler.so"

Based on the output, here's what you need to do:

  • If you don't get any results from that command, continue to the next step.
  • If you get results, skip down to Step 4 (permissions).

Step 3: Check for the required environment variables:

Execute the following, replacing PID with your process ID.

bash
$
xargs --null --max-args=1 < /proc/PID/environ | grep "CORECLR_"

Based on the output, here's what you need to do:

For more details on these variables please see understanding .NET agent environment variables.

Step 4: Check permissions

Check the following permissions tasks:

  • Make sure that the user your application process is running under has read/write/execute permissions to directory where the .NET agent for .NET Core was extracted on your system (CORECLR_NEWRELIC_HOME), and all of its sub-directories.
  • If you made any changes, restart your app and go back to Step 1.

If the above steps did not address the issue, we recommend you contact support on ask for help in Support Forum.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.