search close

.Net Core Module Install

access_time Updated Jun 20, 2021

Requirements

  • .NET Core 2.1 or later.
  • Verify you have installed the Signal Sciences agent for your platform (e.g. Linux or Windows, see Agent Installation instructions.)

Install

  1. Download the latest SigSci HTTP middleware from https://dl.signalsciences.net/?prefix=sigsci-module-dotnetcore/, or get it via Nuget

  2. Add the SigSci HTTP middleware to project. Replace <packagePath> with the path to SignalSciences.HttpMiddleware.<version>.nupkg and <sourcePath> with the folder-based package source to which the package will be added.

    nuget add <packagePath> -Source <sourcePath> -Expand
    dotnet add package SignalSciences.HttpMiddleware -s <sourcePath>

  3. Add the following sections to your application’s appsettings.json file:

    {
        "SigsciOptions": {
            "AgentEndPoint": "127.0.0.1:2345"
        }
    }

  4. Configure HTTP request pipeline in Configure

    Configure(IApplicationBuilder app, IHostingEnvironment env) {
    	var sigsciOptions = Configuration.GetSection("SigsciOptions").Get<SigSciOptions>();
    	app.UseSigSciHandler(sigsciOptions);
    }
    

  5. Restart the web site service (recommended).

Note: Make sure the AgentEndPoint value is set to the same IP and port configured with the Signal Sciences agent’s rpc-address value.

.NET Core Module Configuration

Option Default Description
AgentEndPoint required, no default The TCP endpoint (“host:port”) that the Agent is listening on. “host” can be either a hostname or an IPv4 or IPv6 address.
AgentRpcTimeoutMillis optional, default: 200 Maximum number of milliseconds allowed for each RPC call to the Agent.
MaxPostSize optional, default: 100000 A request body above this size will not be sent to the Agent.
AnomalySize optional, default: 524288 If the HTTP response is this size or larger, log it with the Agent.
AnomalyDurationMillis optional, default: 1000 If the response took longer than this number of milliseconds, log it with the Agent.

Sample advanced .NET Core module configuration:

{
	"SigsciOptions": {
		"AnomalySize": 200000,
		"AgentRPCTimeoutMillis": 200,
		"MaxPostSize": 50000,
		"AnomalyDurationMillis": 1000,
		"AgentEndPoint": "127.0.0.1:2345"
	}
}