C# Class Microsoft.ApplicationInsights.Web.ClientIpHeaderTelemetryInitializer

Telemetry initializer populates client IP address for the current request.
Inheritance: Microsoft.ApplicationInsights.Web.Implementation.WebTelemetryInitializerBase
ファイルを表示 Open project: Microsoft/ApplicationInsights-dotnet-server Class Usage Examples

Public Methods

Method Description
ClientIpHeaderTelemetryInitializer ( ) : System

Initializes a new instance of the ClientIpHeaderTelemetryInitializer class.

Protected Methods

Method Description
OnInitializeTelemetry ( HttpContext platformContext, Microsoft.ApplicationInsights.DataContracts.RequestTelemetry requestTelemetry, ITelemetry telemetry ) : void

Implements initialization logic.

Private Methods

Method Description
CutPort ( string address ) : string
GetIpFromHeader ( string clientIpsFromHeader ) : string
IsCorrectIpAddress ( string address ) : bool
UpdateRequestTelemetry ( HttpContext platformContext, Microsoft.ApplicationInsights.Extensibility.Implementation.LocationContext location ) : void

Method Details

ClientIpHeaderTelemetryInitializer() public method

Initializes a new instance of the ClientIpHeaderTelemetryInitializer class.
public ClientIpHeaderTelemetryInitializer ( ) : System
return System

OnInitializeTelemetry() protected method

Implements initialization logic.
protected OnInitializeTelemetry ( HttpContext platformContext, Microsoft.ApplicationInsights.DataContracts.RequestTelemetry requestTelemetry, ITelemetry telemetry ) : void
platformContext System.Web.HttpContext Http context.
requestTelemetry Microsoft.ApplicationInsights.DataContracts.RequestTelemetry Request telemetry object associated with the current request.
telemetry ITelemetry Telemetry item to initialize.
return void