Errorgap 0.2.0

dotnet add package Errorgap --version 0.2.0
                    
NuGet\Install-Package Errorgap -Version 0.2.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="Errorgap" Version="0.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Errorgap" Version="0.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Errorgap" />
                    
Project file
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 Errorgap --version 0.2.0
                    
#r "nuget: Errorgap, 0.2.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 Errorgap@0.2.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=Errorgap&version=0.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Errorgap&version=0.2.0
                    
Install as a Cake Tool

Errorgap for .NET

.NET error monitoring, APM, and log collection for Errorgap. Two packages:

  • Errorgap — error reporting plus low-level transaction and log delivery
  • Errorgap.AspNetCore — ASP.NET Core middleware, APM instrumentation, and ILogger integration

Requires .NET 8+.

Install

dotnet add package Errorgap.AspNetCore

For non-web apps, depend on Errorgap directly.

ASP.NET Core

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddErrorgap(cfg =>
{
    cfg.Endpoint    = builder.Configuration["ERRORGAP_ENDPOINT"]!;
    cfg.ProjectSlug = builder.Configuration["ERRORGAP_PROJECT_SLUG"]!;
    cfg.ApiKey      = builder.Configuration["ERRORGAP_API_KEY"];
    cfg.ApmEnabled  = true;
    cfg.LogsEnabled = true;
});

var app = builder.Build();
app.UseErrorgap();   // first, so it sees all downstream exceptions
app.MapGet("/", () => "ok");
app.Run();

The middleware reports thrown exceptions, request context, filtered query/form parameters, normalized route patterns, and web transaction timings. It then re-throws so the framework's normal pipeline still handles the response.

When portable PDB file information points to source available in the deployed application, Errorgap includes a bounded source excerpt for application and vendor frames. Set RootDirectory to the application source root to classify application frames and display their paths relative to that root.

APM

With ApmEnabled, ASP.NET Core requests are recorded automatically. Diagnostic listeners add Entity Framework Core/SqlClient query spans and outbound HTTP spans to the current transaction. SQL literals are normalized before delivery.

Wrap background work to report job timings, failures, and any spans created during the operation:

await apm.TrackJobAsync("ReceiptJob", "receipts", () => job.RunAsync());

Set ApmSampleRate between 0 and 1 to sample transactions.

Logs

With LogsEnabled, the ASP.NET Core package registers an ILoggerProvider. Messages at or above MinimumLogLevel are sent with their category, level, and environment:

logger.LogWarning("Payment gateway timeout for {OrderId}", orderId);

Plain .NET

using Errorgap;

ErrorgapSdk.Init(new ErrorgapConfiguration
{
    Endpoint = Environment.GetEnvironmentVariable("ERRORGAP_ENDPOINT")!,
    ProjectSlug = Environment.GetEnvironmentVariable("ERRORGAP_PROJECT_SLUG")!,
    ApiKey = Environment.GetEnvironmentVariable("ERRORGAP_API_KEY"),
});

try { Risky(); }
catch (Exception ex)
{
    ErrorgapSdk.Notify(ex);
    throw;
}

await ErrorgapSdk.FlushAsync();
await ErrorgapSdk.ShutdownAsync();

Init installs AppDomain.UnhandledException and TaskScheduler.UnobservedTaskException hooks by default.

Configuration reference

Property Default Notes
Endpoint ERRORGAP_ENDPOINT or http://127.0.0.1:3030
ProjectSlug ERRORGAP_PROJECT_SLUG Required
ProjectId ERRORGAP_PROJECT_ID
ApiKey ERRORGAP_API_KEY Sent as x-errorgap-project-key
Environment ERRORGAP_ENVIRONMENT or production
Release
Async true Uses a bounded background delivery queue
FilterKeys password, token, … Substring, case-insensitive
Timeout 5 s HTTP request timeout
QueueSize 100
RootDirectory Current directory Source lookup and app-frame classification
ApmEnabled ERRORGAP_APM_ENABLED or false Automatic ASP.NET Core APM
ApmSampleRate ERRORGAP_APM_SAMPLE_RATE or 1 Clamped to 01
LogsEnabled ERRORGAP_LOGS_ENABLED or false Enables ILogger delivery
MinimumLogLevel ERRORGAP_MINIMUM_LOG_LEVEL or Warning Case-insensitive .NET log level
DiagnosticLogger Optional callback for delivery failures

Development

dotnet test

License

MIT.

Product 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 (1)

Showing the top 1 NuGet packages that depend on Errorgap:

Package Downloads
Errorgap.AspNetCore

ASP.NET Core middleware for Errorgap error tracking.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0 115 7/19/2026
0.1.0 130 7/7/2026