Skip to content

Commit

Permalink
Merge branch 'main' into resource-detectors
Browse files Browse the repository at this point in the history
  • Loading branch information
Kielek authored Apr 11, 2023
2 parents bfb748e + 7c00f57 commit 8facd9d
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .cspell/other.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ GRPCNETCLIENT
ENTITYFRAMEWORKCORE
ENVIRONMENTALVARIABLES
TELEMETRYSDK
appcmd
inetsrv
32 changes: 27 additions & 5 deletions docs/iis-instrumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,12 @@ Register-OpenTelemetryForIIS
This step is necessary only for ASP.NET (.NET Framework).

> **Note**
> There are three distinct options.
Add `OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule, OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule`
ASP.NET HTTP module to your application's `Web.config`.
You can add it in the following places:
by modifying and extending `web.config` (first two options)
or `applicationHost.config` (third option).

```xml
<system.web>
Expand All @@ -38,6 +41,11 @@ You can add it in the following places:
</system.web>
```

> **Warning**
> After applying above changes you might experience following error as this configuration
> requires IIS classic mode.
> In order to fix it you can switch to classic mode or use other options. ![error](./images/iis-500-22-error.png).
```xml
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
Expand All @@ -48,9 +56,9 @@ You can add it in the following places:
</system.webServer>
```

The ASP.NET HTTP module can be also set in `applicationHost.config`.
Here is an example where you can add the module
to set it for all ASP.NET application running in Integrated Pipeline Mode:
> **Note** `applicationHost.config` is located in `%SystemDrive%\Windows\system32\inetsrv\config`.
> Below is an example where you can add the module
> to set it for all ASP.NET application running in Integrated Pipeline Mode:
```xml
<location path="" overrideMode="Allow">
Expand All @@ -62,6 +70,20 @@ to set it for all ASP.NET application running in Integrated Pipeline Mode:
</location>
```

> **Note** After applying above changes you can check whether `opentelemetry modules`
> are loaded by using `appcmd` command which can be found under `%SystemDrive%\Windows\system32\inetsrv`.
> Following example shows invocation for `WebDemo\` application:
```terminal
appcmd list modules /app.name:"WebDemo/"
```

and correct result:

```terminal
MODULE "TelemetryHttpModule" ( type:OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule, OpenTelemetry.Instrumentation.AspNet.TelemetryHttpModule, preCondition:managedHandler )
```

## Configuration

> **Note**
Expand Down
Binary file added docs/images/iis-500-22-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8facd9d

Please sign in to comment.