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
Importante
- 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
Dica
- If you installed our agent for .NET Core, or installed either agent with the
NewRelic.Agent
NuGet package, you'll find alogs
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).
- 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.
- Restart your application.
- 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.
- 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
orpidof the_process_name
. - 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
. - If you see that
profiler log
file in the logs directory, then also check to see if there is a corresponding agent log. - 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. - 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:
- If you get no results, set your environment variables, restart your application, and go back to Step 1.
- If you get results, make sure all four required variables are set and have valid values:
CORECLR_ENABLE_PROFILING
: Must always be set to 1.CORECLR_PROFILER
: Must always be set to{36032161-FFC0-4B61-B559-F6C5D41BAE5A}
.CORECLR_NEWRELIC_HOME
: Must be set to the fully qualified path to the agent directory for .NET Core (the directory wherenewrelic.config
,libNewRelicProfiler.so
, and the extensions directory are located).CORECLR_PROFILER_PATH
: Must be set to the fully qualified path to the filelibNewRelicProfiler.so
. This is almost always equal toCORECLR_NEWRELIC_HOME
+/libNewRelicProfiler.so
.
- If you made any changes to your environment variables, restart your app and go back to Step 1.
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.