Advanced configuration for IIS applications
Follow these advanced configuration steps to make changes to specific application pools.
Set environment variables
You can set environment variables for specific application pools in the environmentVariables block of the applicationHost.config file .
For example:
<environmentVariables>
<add name="OTEL_RESOURCE_ATTRIBUTES" value="deployment.environment=test,service.version=1.0.0" />
</environmentVariables>For all IIS applications, consider setting common environment variables for W3SVC and WAS Windows Services. For more information, see Instrument a Windows Service running a .NET application in the OpenTelemetry documentation.
environmentVariable block and in the web.config appSettings block, the value in the environmentVariables block takes precedence.Activate or deactivate instrumentation for specific application pools
Import the PowerShell module that you have installed for Splunk Distribution of OpenTelemetry .NET.
Import-Module "<path-to-Splunk.OTel.DotNet.psm1>"Activate or deactivate instrumentation.
Tip: The application pool name is case sensitive.Activate instrumentation for the application pool:
Enable-OpenTelemetryForIISAppPool -AppPoolName <application-pool-name>Deactivate instrumentation for the application pool:
Disable-OpenTelemetryForIISAppPool -AppPoolName <application-pool-name>
Restart the application pool:
Restart-WebAppPool -Name <application-pool-name>