<private-data-key>: The agent installation key used by APM Dotnet agents (private dataKey) which is generated when the APM domain is created. For information, see Obtain Data Upload Endpoint and Data Keys.
<service-name>: The name of the service being monitored. This enables you to filter by service and view traces in the Trace Explorer user interface.
You can add more environment variables if needed. For example, if you need to configure browser agent injection or abridged trace. The environment variable name should use the prefix $env: and the environment variable value should be quoted by double quotes "".
Best Practice: Run clear-history after deploying the APM .NET agent. This cleans up sensitive data such as private data key from the PowerShell history.
Optional - Register .NET Framework DLLs in GAC.
This step is only required by .NET framework applications. If you do not have .NET framework application, skip this step.
To register .NET framework DLLs in GAC, do the following:
Register-OpenTelemetryDllsToGac
Deploy the APM Dotnet agent.
Deploy the APM Dotnet agent on the following applications:
Here's information on how to deploy the APM Dotnet agent on Console
Application.
Prepare the environment variables to deploy the APM Dotnet agent.
Review the following environment variables that are needed for deploying APM Dotnet agent for console application:
set COR_ENABLE_PROFILING=1
set COR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
set COR_PROFILER_PATH_64=<destination>\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll
set COR_PROFILER_PATH_32=<destination>\win-x86\OpenTelemetry.AutoInstrumentation.Native.dll
set CORECLR_ENABLE_PROFILING=1
set CORECLR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
set CORECLR_PROFILER_PATH_64=<destination>\win-x64\OpenTelemetry.AutoInstrumentation.Native.dll
set CORECLR_PROFILER_PATH_32=<destination>\win-x86\OpenTelemetry.AutoInstrumentation.Native.dll
set DOTNET_ADDITIONAL_DEPS=<destination>\AdditionalDeps
set DOTNET_SHARED_STORE=<destination>\store
set DOTNET_STARTUP_HOOKS=<destination>\net\OpenTelemetry.AutoInstrumentation.StartupHook.dll
set ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=OpenTelemetry.AutoInstrumentation.AspNetCoreBootstrapper
set OTEL_DOTNET_AUTO_HOME=<destination>
set OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES=OpenTelemetry.ODP
set OTEL_SERVICE_NAME=<service-name>
set OTEL_LOGS_EXPORTER=none
set OTEL_DOTNET_AUTO_EXCLUDE_PROCESSES=dotnet.exe,dotnet
set OTEL_EXPORTER_OTLP_ENDPOINT=<data-upload-endpoint>/20200101/opentelemetry
set OTEL_EXPORTER_OTLP_HEADERS=Authorization=dataKey <private-data-key>
set OTEL_DOTNET_ENABLE_BACKGROUND_ODP=true
set OTEL_DOTNET_ENABLE_CONNECTION_ODP=true
The following must be replaced with the correct values:
Placeholder
Description
<destination>
The destination directory in which the APM Dotnet Agent is provisioned.
For example: C:\tracer-home
<service-name>
The name of the service being monitored.
This enables you to filter by service and view traces in the Trace Explorer user interface.
For example: apm_service
<data-upload-endpoint>
The dataUploadEndpoint URL that is generated when the APM domain is created.
For example: https://dataUploadEndpoint.com
<private-data-key>
The agent installation key used by the APM Dotnet agent (private dataKey), which is generated when the APM domain is created.