search close

.Net Core Module Install

access_time Updated Mar 27, 2023

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.

Installation

  1. Download the latest SigSci HTTP middleware using one these methods:

  2. Add the SigSci HTTP middleware to your 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 the HTTP request pipeline with Configure:

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

Note: Ensure the AgentEndPoint value is set to the same IP and port configured with the Signal Sciences agent’s rpc-address value. See the Windows agent installation documentation for additional information about Windows agent configuration options.

.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"
	}
}