Site24x7.Chaos
1.1.2
dotnet add package Site24x7.Chaos --version 1.1.2
NuGet\Install-Package Site24x7.Chaos -Version 1.1.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Site24x7.Chaos" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Site24x7.Chaos" Version="1.1.2" />
<PackageReference Include="Site24x7.Chaos" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Site24x7.Chaos --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Site24x7.Chaos, 1.1.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Site24x7.Chaos@1.1.2
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Site24x7.Chaos&version=1.1.2
#tool nuget:?package=Site24x7.Chaos&version=1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Site24x7 Labs Chaos SDK for .NET
Inject realistic application-level faults into ASP.NET Core microservices. Faults are controlled from the Site24x7 Labs UI, injected via this SDK embedded in the target app, and captured by Site24x7 APM to showcase its monitoring capabilities.
Quick Start
Install
dotnet add package Site24x7.Chaos
Initialize (one line)
using Site24x7.Chaos.Extensions;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddSite24x7Chaos();
var app = builder.Build();
app.UseSite24x7Chaos();
app.Run();
Set environment variables
export CHAOS_SDK_ENABLED=true
export CHAOS_SDK_APP_NAME=auth-service
export CHAOS_SDK_CONFIG_DIR=/var/site24x7-labs/faults
Mount the shared volume
In Docker Compose, add a shared volume so the agent can write config files and the SDK can read them:
services:
auth-service:
volumes:
- chaos_config:/var/site24x7-labs/faults:ro
That's it. No other code changes required.
Supported Fault Types (19)
| # | Fault Type | Category | Description |
|---|---|---|---|
| 1 | http_exception |
Inbound HTTP | Throw a mapped .NET exception |
| 2 | http_latency |
Inbound HTTP | Add artificial latency to requests |
| 3 | http_error_response |
Inbound HTTP | Return a static error response |
| 4 | http_connection_reset |
Inbound HTTP | Abort the connection |
| 5 | http_slow_body |
Inbound HTTP | Stream a response body with inter-chunk delays |
| 6 | http_client_latency |
Outbound HTTP | Add latency to outbound HttpClient calls |
| 7 | http_client_exception |
Outbound HTTP | Throw an exception on outbound calls |
| 8 | http_client_error_response |
Outbound HTTP | Return a fake error response from outbound calls |
| 9 | jdbc_exception |
Database | Throw a DbException before queries |
| 10 | jdbc_latency |
Database | Add latency before queries |
| 11 | jdbc_connection_pool_drain |
Database | Hold connections from the pool |
| 12 | redis_exception |
Redis | Throw a RedisException on commands |
| 13 | redis_latency |
Redis | Add latency before Redis commands |
| 14 | thread_pool_exhaustion |
Resource | Block ThreadPool threads |
| 15 | memory_pressure |
Resource | Allocate large byte arrays on the managed heap |
| 16 | cpu_burn |
Resource | Tight math loops across threads |
| 17 | gc_pressure |
Resource | Rapid short-lived allocations to stress the GC |
| 18 | thread_deadlock |
Resource | Tasks deadlocked on SemaphoreSlim |
| 19 | disk_fill |
Resource | Write temp files to consume disk space |
Documentation
See docs/integration-guide.md for the full integration guide.
Requirements
- .NET 8.0+
- ASP.NET Core
- Access to the Site24x7 Labs agent shared volume
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- StackExchange.Redis (>= 2.7.33)
- System.Text.Json (>= 8.0.6)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.