Checkend 1.0.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Checkend --version 1.0.0
NuGet\Install-Package Checkend -Version 1.0.0
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="Checkend" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Checkend" Version="1.0.0" />
<PackageReference Include="Checkend" />
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 Checkend --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Checkend, 1.0.0"
#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 Checkend@1.0.0
#: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=Checkend&version=1.0.0
#tool nuget:?package=Checkend&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Checkend .NET SDK
.NET SDK for Checkend error monitoring. Async by default with ASP.NET Core integration.
Features
- Async by default - Non-blocking error sending via Channel<T>
- ASP.NET Core Middleware - Easy integration with web apps
- Automatic context - Request, user, and custom context tracking
- Sensitive data filtering - Automatic scrubbing of passwords, tokens, etc.
- Testing utilities - Capture errors in tests without sending
Requirements
- .NET 8.0+
- No external dependencies
Installation
NuGet
dotnet add package Checkend
Package Manager
Install-Package Checkend
Quick Start
using Checkend;
// Configure the SDK
CheckendClient.Configure(builder => builder
.ApiKey("your-api-key")
);
// Report an error
try
{
DoSomething();
}
catch (Exception ex)
{
CheckendClient.Notify(ex);
}
Configuration
CheckendClient.Configure(builder => builder
.ApiKey("your-api-key") // Required
.Endpoint("https://app.checkend.io") // Optional: Custom endpoint
.Environment("production") // Optional: Auto-detected
.Enabled(true) // Optional: Enable/disable
.AsyncSend(true) // Optional: Async sending (default: true)
.MaxQueueSize(1000) // Optional: Max queue size
.Timeout(15000) // Optional: HTTP timeout in ms
.AddFilterKey("custom_secret") // Optional: Additional keys to filter
.AddIgnoredException<MyException>() // Optional: Exceptions to ignore
.Debug(false) // Optional: Enable debug logging
);
Environment Variables
CHECKEND_API_KEY=your-api-key
CHECKEND_ENDPOINT=https://your-server.com
CHECKEND_ENVIRONMENT=production
CHECKEND_DEBUG=true
Manual Error Reporting
// Basic error reporting
try
{
RiskyOperation();
}
catch (Exception ex)
{
CheckendClient.Notify(ex);
}
// With additional context
try
{
ProcessOrder(orderId);
}
catch (Exception ex)
{
CheckendClient.Notify(ex, new NoticeOptions
{
Context = new Dictionary<string, object?> { ["order_id"] = orderId },
User = new Dictionary<string, object?> { ["id"] = userId, ["email"] = userEmail },
Tags = new List<string> { "orders", "critical" },
Fingerprint = "order-processing-error"
});
}
// Synchronous sending (blocks until sent)
var response = await CheckendClient.NotifySyncAsync(ex);
if (response.IsSuccess)
{
Console.WriteLine("Notice sent successfully");
}
Context & User Tracking
// Set context for all errors in this async context
CheckendClient.SetContext(new Dictionary<string, object?>
{
["order_id"] = 12345,
["feature_flag"] = "new-checkout"
});
// Set user information
CheckendClient.SetUser(new Dictionary<string, object?>
{
["id"] = user.Id,
["email"] = user.Email,
["name"] = user.Name
});
// Set request information
CheckendClient.SetRequest(new Dictionary<string, object?>
{
["url"] = HttpContext.Request.Path,
["method"] = HttpContext.Request.Method
});
// Clear all context (call at end of request)
CheckendClient.Clear();
ASP.NET Core Integration
Using Middleware
// Program.cs
var builder = WebApplication.CreateBuilder(args);
// Add Checkend using configuration
builder.Services.AddCheckend(builder.Configuration);
// Or configure directly
builder.Services.AddCheckend(config => config
.ApiKey("your-api-key")
.Environment("production")
);
var app = builder.Build();
// Use Checkend middleware for automatic error reporting
app.UseCheckend();
app.Run();
appsettings.json
{
"Checkend": {
"ApiKey": "your-api-key",
"Endpoint": "https://app.checkend.io",
"Environment": "production",
"Enabled": true,
"Debug": false
}
}
Global Exception Handler
app.UseExceptionHandler(errorApp =>
{
errorApp.Run(async context =>
{
var exceptionFeature = context.Features.Get<IExceptionHandlerFeature>();
if (exceptionFeature?.Error != null)
{
CheckendClient.Notify(exceptionFeature.Error);
}
context.Response.StatusCode = 500;
await context.Response.WriteAsync("Internal Server Error");
});
});
Testing
Use the Testing class to capture errors without sending them:
using Checkend;
using Xunit;
public class MyTests : IDisposable
{
public MyTests()
{
Testing.Setup();
CheckendClient.Configure(builder => builder
.ApiKey("test-key")
.Enabled(true)
);
}
public void Dispose()
{
Testing.Teardown();
CheckendClient.ResetAsync().GetAwaiter().GetResult();
}
[Fact]
public void TestErrorReporting()
{
try
{
throw new InvalidOperationException("Test error");
}
catch (Exception ex)
{
CheckendClient.Notify(ex);
}
Assert.True(Testing.HasNotices());
Assert.Equal(1, Testing.NoticeCount());
var notice = Testing.LastNotice();
Assert.Equal("System.InvalidOperationException", notice?.ErrorClass);
}
}
Filtering Sensitive Data
By default, these keys are filtered: password, secret, token, api_key, authorization, credit_card, cvv, ssn, etc.
Add custom keys:
CheckendClient.Configure(builder => builder
.ApiKey("your-api-key")
.AddFilterKey("custom_secret")
.AddFilterKey("internal_token")
);
Filtered values appear as [FILTERED] in the dashboard.
Ignoring Exceptions
CheckendClient.Configure(builder => builder
.ApiKey("your-api-key")
.AddIgnoredException<ResourceNotFoundException>()
.AddIgnoredException("OperationCanceledException")
.AddIgnoredException(new Regex(".*NotFound.*"))
);
Before Notify Callbacks
CheckendClient.Configure(builder => builder
.ApiKey("your-api-key")
.AddBeforeNotify(notice =>
{
// Add extra context
notice.Context["server"] = Environment.MachineName;
return notice;
})
.AddBeforeNotify(notice =>
{
// Skip certain errors
if (notice.Message.Contains("ignore-me"))
{
return false;
}
return true;
})
);
Graceful Shutdown
The SDK automatically flushes pending notices. For manual control:
// Wait for pending notices to send
await CheckendClient.FlushAsync();
// Stop the worker
await CheckendClient.StopAsync();
Development
# Build
dotnet build
# Run tests
dotnet test
# Pack
dotnet pack
Publishing to NuGet
Via GitHub Actions UI (Recommended)
- Go to Actions → Publish to NuGet → Run workflow
- Enter the version number (e.g.,
0.2.0) - Click Run workflow
The workflow will automatically:
- Update the version in the csproj
- Build and run tests
- Commit the version change
- Create a git tag and GitHub release
- Publish to NuGet
Via GitHub Release
- Update the version in
src/Checkend/Checkend.csproj - Commit and push the version change
- Create a new GitHub release with a tag (e.g.,
v0.1.0) - The publish workflow will automatically build, test, and push to NuGet
Manual Publishing
dotnet pack src/Checkend/Checkend.csproj -c Release
dotnet nuget push src/Checkend/bin/Release/Checkend.*.nupkg \
--api-key YOUR_API_KEY \
--source https://api.nuget.org/v3/index.json
License
MIT License - see LICENSE for details.
| 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
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.