SolarWindsAPM.OpenTelemetry.Agent NuGet package (Beta)
The .NET Library with OpenTelemetry support can be added to your project using the SolarWindsAPM.OpenTelemetry.Agent
Nuget package. The NuGet package contains the .NET Library assemblies, some dependent libraries, and the solarwinds_apm.config
file, which contains configuration options.
Use the NuGet package in the following scenarios:
-
You control the application build but not the machine/container where the application is running.
-
Support instrumentation of
self-contained
applications. Note thatself-contained
single-file
applications require additional setup.
To enable automatic instrumentation:
-
Add the SolarWindsAPM.OpenTelemetry.Agent NuGet package to your .NET 8+ project.
-
Set the Service key in the
solarwinds_apm.config
file that is published as part of the SolarWindsAPM.OpenTelemetry.Agent NuGet package. The file is published in the root folder of the published app. Alternatively, the Service key can be set using the environment variableSW_APM_SERVICE_KEY
. -
All the files published in the SolarWindsAPM.OpenTelemetry.Agent NuGet package must be deployed with your application.
-
Set the environment variables as described below. The required environment variables below are:
SW_APM_HOME_DOTNET
,CORECLR_ENABLE_PROFILING
,CORECLR_PROFILER
and profiler path (CORECLR_PROFILER_PATH
,CORECLR_PROFILER_PATH_32
orCORECLR_PROFILER_PATH_64
). -
Enable OpenTelemetry support, OpenTelemetry must be enabled in the APM Library by using one of the following configuration settings:
-
Set
OpenTelemetry
toEnabled
in the solarwinds_apm.config file:-
<add key="OpenTelemetry" value="Enabled" />
-
-
Set the
SW_APM_OPEN_TELEMETRY
environment variable to Enabled:-
SW_APM_OPEN_TELEMETRY=Enabled
-
-
-
After adding the NuGet package to your project and configuring the environment variables, the automatic instrumentation starts traces and reports spans.
The SolarWindsAPM.OpenTelemetry.Agent NuGet package contains a native shared library oboe_<major>_<minor>_<patch>.dll
for Windows platforms and oboe_<major>_<minor>_<patch>.so
for Linux platforms. The SolarWindsAPM.OpenTelemetry.Agent package must be able to find and load the native shared library and its dependencies at runtime. The .NET 8+ runtime looks for the shared library in either the application published folder or in one of the following directories:
-
For published files where a target runtime was specified:
<published-dotnet-app>
-
For published files where a target runtime was not specified:
-
For 64-bit applications on the Windows platform:
<published-dotnet-app>\runtimes\win-x64\native\
-
On the Linux platform:
<published-dotnet-core-app>/runtimes/linux-x64/native/
-
On the Alpine platform:
<published-dotnet-core-app>/runtimes/linux-musl-x64/native/
-
See Troubleshoot the .NET Library: Can the Linux SDK find and load the native shared library? for details.
Configuring automatic instrumentation
To configure the automatic instrumentation feature of the .NET Library, add the following environment variables for the process that you would like to instrument. The environment variables can also be set at a system level but that is not recommended.
For Windows
Environment variable | Environment variable value |
---|---|
SW_APM_SERVICE_KEY |
(Optional) This overrides what is set in the The Service key is used to identify your account and the service being instrumented. It is shown in the Add Data dialog when you add the new service. It should be in the form of The service name is also called the entity's service ID in SolarWinds Observability SaaS. The service name can also be seen in the Overview tab in the service entity's Entity Explorer details view. Editing the display name of the service entity in SolarWinds Observability SaaS does not affect the Service key. |
SW_APM_HOME_DOTNET
|
<published-dotnet-app>
|
SW_APM_COLLECTOR
|
This overrides what is set for the The |
CORECLR_ENABLE_PROFILING
|
1 |
CORECLR_PROFILER
|
{AAAA7777-11FE-4F94-8EDA-312C0EDF4141}
|
Target Runtime Not Selected: | |
CORECLR_PROFILER_PATH_64
|
<published-dotnet-app>\runtimes\win-x64\native\solarwinds_apm_profiler.dll
|
or Target Runtime Selected: |
|
CORECLR_PROFILER_PATH
|
<published-dotnet-app>\solarwinds_apm_profiler.dll
|
All IIS (w3wp.exe) and dotnet.exe processes are instrumented automatically. If your application has a different process name, define the process name in the solarwinds_apm.config file. For information about configuring an application: for Windows, see Installation for stand-alone, non-IIS applications, and for Linux, see Instrumenting .NET 6+ executables.
For Linux and Alpine
Environment variable | Environment variable value |
---|---|
SW_APM_SERVICE_KEY
|
(Optional) This overrides what is set in the The Service key is used to identify your account and the service being instrumented. It is shown in the Add Data dialog when you add the new service. It should be in the form of The service name is also called the entity's service ID in SolarWinds Observability SaaS. The service name can also be seen in the Overview tab in the service entity's Entity Explorer details view. Editing the display name of the service entity in SolarWinds Observability SaaS does not affect the Service key. |
SW_APM_HOME_DOTNET
|
<published-dotnet-app>
|
SW_APM_COLLECTOR
|
This overrides what is set for the The |
CORECLR_ENABLE_PROFILING
|
1
|
CORECLR_PROFILER
|
{AAAA7777-11FE-4F94-8EDA-312C0EDF4141}
|
Target Runtime Not Selected: | |
Linux x64
|
<published-dotnet-app>/runtimes/linux-x64/native/solarwinds_apm_profiler.so
|
Alpine x64
|
<published-dotnet-app>/runtimes/linux-musl-x64/native/solarwinds_apm_profiler.so
|
Linux arm64
|
<published-dotnet-app>/runtimes/linux-arm64/native/solarwinds_apm_profiler.so
|
Alpine arm64
|
<published-dotnet-app>/runtimes/linux-musl-arm64/native/solarwinds_apm_profiler.so
|
Target Runtime Selected: | |
CORECLR_PROFILER_PATH
|
<published-dotnet-app>/solarwinds_apm_profiler.so
|
Any application that starts with the dotnet command (runs under the dotnet process) is automatically considered for instrumentation. See Instrumenting .NET 6+ executables.
Troubleshooting
After you install the library, if traces and metric data do not appear in the Traces Explorer and Metrics Explorer, see Troubleshoot the .NET Library for resolution tips.
Log file locations
The SolarWindsAPM.OpenTelemetry.Agent NuGet package logs detailed information about problems it runs into, which can provide helpful information when troubleshooting. In a standard environment, the log files can be found in the following locations:
Linux: /var/tmp/solarwinds
Windows: C:\ProgramData\SolarWinds\APM\dotnet\logs
NuGet package compatibility with the Windows or Linux Library
The SolarWindsAPM.OpenTelemetry.Agent
NuGet package can be added to an application that is deployed to a server where the Windows (SolarWindsAPM_DotNetAgent_Setup.exe
) or Linux (tgz archive) APM library is installed. The location of the solarwinds_apm.config
configuration file used by an application on the server depends on the environment variables set.