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
-
Download the latest SigSci HTTP middleware using one these methods:
- Directly from https://dl.signalsciences.net/?prefix=sigsci-module-dotnetcore/
- Via Nuget
-
Add the SigSci HTTP middleware to your project. Replace
<packagePath>
with the path toSignalSciences.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>
-
Add the following sections to your application’s
appsettings.json
file:{ "SigsciOptions": { "AgentEndPoint": "127.0.0.1:2345" } }
-
Configure the HTTP request pipeline with
Configure
:Configure(IApplicationBuilder app, IHostingEnvironment env) { var sigsciOptions = Configuration.GetSection("SigsciOptions").Get<SigSciOptions>(); app.UseSigSciHandler(sigsciOptions); }
-
Restart the web site service.
Note: Ensure the
AgentEndPoint
value is set to the same IP and port configured with the Signal Sciences agent’srpc-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"
}
}