You can do it this way:
<TelemetryChannel Type="Namespace.MyTelemetryChannel, OtherAssemblyName" />
Namespace.MyTelemetryChannel
should be your fully qualified type name for your class
- It should be followed by the assembly name eg.
OtherAssemblyName
Default ITelemetryChannel:
The default channel used by ApplicationInsights.Web is ServerTelemetryChannel
which is present by default in the ApplicationInsights.config file:
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel"/>
If you check the references in your project you'll find Microsoft.AI.ServerTelemetryChannel
is the assembly from where ServerTelemetryChannel
is initialized.
Initializing properties with ITelemetryChannel:
You can also initialize properties (as long as they have public getters and setters) from the ApplicationInsights.config, as shown below:
<TelemetryChannel Type="Namespace.MyTelemetryChannel, OtherAssemblyName">
<SomeCount>20</SomeCount>
</TelemetryChannel>
assuming your TelemetryChannel includes the property SomeCount
:
public class MyTelemetryChannel: ITelemetryChannel
{
public int SomeCount { get; set; }
...
}
Hope this helps!