.Net Core module install
Last updated 2023-04-05
Requirements
- .NET Core 2.1 or later.
- Verify you have installed the Signal Sciences agent for your platform (e.g., Linux or Windows). Check out our Getting started with the agent guide.
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> -Expanddotnet add package SignalSciences.HttpMiddleware -s <sourcePath>Add the following sections to your application's
appsettings.json
file:1{2 "SigsciOptions": {3 "AgentEndPoint": "127.0.0.1:2345"4 }5}Configure the HTTP request pipeline with
Configure
:1Configure(IApplicationBuilder app, IHostingEnvironment env) {2 var sigsciOptions = Configuration.GetSection("SigsciOptions").Get<SigSciOptions>();3 app.UseSigSciHandler(sigsciOptions);4}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. |
ExpectedContentTypes | optional, no default | Adds custom types that allow inspection to the conditional content-type list. |
Sample advanced .NET Core module configuration
1{2 "SigsciOptions": {3 "AnomalySize": 200000,4 "AgentRPCTimeoutMillis": 200,5 "MaxPostSize": 50000,6 "AnomalyDurationMillis": 1000,7 "AgentEndPoint": "127.0.0.1:2345",8 "ExpectedContentTypes": "application/custom-abc application/hal-test"9 }10}
Do not use this form to send sensitive information. If you need assistance, contact support. This form is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.