Docs » Supported integrations in Splunk Observability Cloud » Instrument back-end applications to send spans to Splunk APM » Instrument .NET applications for Splunk Observability Cloud (OpenTelemetry) » Advanced configuration for IIS applications

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.

Note

If the same environment variables are set in the environmentVariable block and in the web.config appSettings block, the value in the environmentVariables block takes precedence.

Activate or deactivate instrumentation 🔗

For .NET Framework applications, use the PowerShell module to activate or deactivate the instrumentation for specific application pools.

  1. Import the PowerShell module:

    Import-Module "OpenTelemetry.DotNet.Auto.psm1"
    

    Note

    The application pool name is case sensitive.

  2. Activate or deactivate the application pool.

    • Activate instrumentation for the application pool:

      Enable-OpenTelemetryForIISAppPool -AppPoolName <app-pool>
      
    • Deactivate instrumentation for the application pool:

      Disable-OpenTelemetryForIISAppPool -AppPoolName <app-pool>
      
  3. Restart the application pool:

    Restart-WebAppPool -Name <app-pool>
    

This page was last updated on Sep 18, 2024.