App Agents - IIS Element
The IIS
element is a child of the app-agents
element. There are three options to configure IIS applications:
- Automatic configuration
- Application pool configuration
- Application configuration
The settings for any application pool apply to all applications within the app pool unless the individual application has a specific configuration.
Explicit child-level configurations override parent-level configurations. Otherwise, children inherit parent configurations.
Optional Element: <IIS>
Exclude child applications attribute
By default, when you instrument an IIS application, the .NET Agent instruments any child applications and assigns them to the same tier as the parent.To prevent the agent from automatically instrumenting child applications, set exclude-child-applications
to true
. For instance: <IIS exclude-child-applications="true">
If you disable instrumentation for child applications in general, you can instrument-specific child applications using the IIS Application element.
Type:Boolean
Default: false
Required: No
IIS Automatic Instrumentation Element
The automatic
element is a child of the IIS
element. Use the automatic
element to enable or disable automatic instrumentation for all IIS apps. You can configure automatic instrumentation and manual instrumentation both. Manual configurations override automatic ones.
Optional Element: <automatic enabled="false" />
Automatic enabled attribute
Set the automatic enabled
attribute to true to enable instrumentation for all IIS applications. This is the default setting if you use the .NET Agent Configuration Utility automatic configuration option. To disable automatic instrumentation for all IIS applications, set the value to false.
Type: Boolean
Default: true
Required: No
IIS Application name enabled attribute
By default, the agent does not report an IIS application name. To view the IIS application name in the CLR metadata, set the iis-application-name-enabled
attribute to true. For example, <automatic iis-application-name-enabled="true" />
. When enabled, the name appears as the iis-application-name
value in the CLR metadata.
Type: Boolean
Default: false
Required: No
IIS Application Pools Element
The IIS application pools
element is a child of the IIS
element. It is a container element for all the IIS application pools you configure for instrumentation.
Optional Element: <application-pools>
IIS Application Pool Element
The application-pool
element is a child of the application-pools
element. You may have multiple application pool elements distinguished by the name attribute. Use the application pool element to configure the app agent for all applications within an application pool. For more information on IIS application pools, see Managing Application Pools in IIS.
Optional Element: <application-pool name="DefaultAppPool" enabled="false">
Application pool name attribute
The application-pool name
attribute indicates the name of the IIS Application Pool.
Type: String
Default: None
Required: Name is required for the application-pool element.
Application pool enabled attribute
Set the application-pool enabled
attribute to false to disable instrumentation for all applications in the application pool. Set the value to true to instrument all applications in the application pool.
Type: Boolean
Default: None. Defaults to true if not specified.
Required: No
Application Pool Tier Element
The tier
element is a child of the application-pool
element. If you enable instrumentation for an application pool, you must use a tier
element to assign the applications of a pool to a tier in the Controller. See Overview of Application Monitoring
Required Element: <tier name="Inventory" />
Tier name attribute
Use the tier name
attribute to specify the tier.
Type: String, may also reference an environment variable. See Reference of Environment Variables.
Default: None
Required: Yes
IIS Applications Element
The IIS applications
element is a child of the IIS
element. It is a container element for all the IIS applications you configure for instrumentation.
Optional Element: <applications>
Application Element
The application
element is a child of the applications
element. Use multiple application elements to instrument different sites and applications. To learn more about IIS sites and applications, see Understanding Sites, Applications, and Virtual Directories on IIS 7 and Above
Optional Element: <application path="/" site="FirstSite" port="8008"site-regex="false">
Application site attribute
The application
site
attribute indicates the root site in IIS for the application. The site name accepts a regular expression for cases like Windows Azure where you may only know a partial site name. If you use a regular expression, set the Application site-regex attribute to true.
Type: String
Default: None
Required: The site is required for the Application element.
Application site-regex attribute
Set the application site-regex
attribute to true to treat the value of the Application site
attribute as a regular expression.
Type: Boolean
Default: false
Required: No
Application path attribute
The application path
attribute indicates the path of the application, relative to the root site. Use the forward slash to indicate the root site and instrument all children applications. Use the path to an application to instrument the specific application and any children.
For example, Site1 hosts two applications AppX
and AppY
. To instrument Site 1, AppY
and AppZ
, set the path to "/". To instrument AppY
, but not AppZ
, set the path to /AppY
.
Type: String
Default: /
Required: path is required for the application
element.
Application port attribute
For cases where two or more sites in IIS 6 have the same site name, set the site port
attribute to differentiate between the sites.
Type: Positive Integer
Default: None
Required: No
Application enabled attribute
In certain cases you may want to enable instrumentation for a parent application, but disable it for a child application. In this case create an application
element for the child application to disable and set the application enabled
attribute to false.
Type: Boolean
Default: true
Required: No
Application Tier Element
The e tier
element is a child of the application
element. If you enable instrumentation for an application, you must use a tier
element to assign the application to a tier in the Controller. See Overview of Application Monitoring
Required Element: <tier name="Consumer" />
Tier name attribute
The tier name
attribute indicates the business application tier.
Type: String, may also reference an environment variable. See Reference of Environment Variables.
Default: None
Required: Yes
Sample IIS Application Configuration
<IIS>
<!-- Automatic instruments all IIS applications when enabled. -->
<automatic enabled="false" />
<!-- Application Pool agent configurations -->
<application-pools>
<!-- Do not instrument applications in DefaultAppPool when "enabled" attribute is set to false. -->
<application-pool name="DefaultAppPool" enabled="false">
<tier name="Tier Name"/>
</application-pool>
<!-- Instrument applications in the OtherAppPpool and assign them to the Inventory tier. -->
<application-pool name="OtherAppPool">
<tier name="Inventory"/>
</application-pool>
</application-pools>
<applications>
<!-- Instrument all applications in the First Site. -->
<application path="/" site="FirstSite">
<tier name="Order"/>
</application>
<!-- Instrument the /app application and child apps in the Second Site -->
<!-- but not the root Second Site application. -->
<application path="/app" site="SecondSite">
<tier name="Consumer"/>
</application>
<!-- Regular expression for site name -->
<!-- assigns all sites beginning with "MyRole" to the Credit Services tier. -->
<application path="/" site="MyRole_\w+" site-regex="true">
<tier name="Credit Services"/>
</application>
</applications>
</IIS>