ApiGaze.AspNetCore 0.0.1-alpha2

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

ApiGaze.AspNetCore

ApiGaze is a powerful API monitoring and telemetry middleware for ASP.NET Core applications. It helps you capture, analyze, and monitor your API traffic with ease.

Features

  • 🔍 Capture HTTP request and response data
  • 🔒 Built-in sensitive data redaction
  • ⚡ Efficient buffering and batching
  • 🛡️ Configurable path exclusions
  • 📊 Rich telemetry data collection
  • 🔄 Background processing
  • 🎯 Flexible configuration options

Installation

dotnet add package ApiGaze.AspNetCore --version 0.1.0-beta1

Quick Start

  1. Create an application in the ApiGaze dashboard and get your Application ID

  2. Add ApiGaze to your application:

var builder = WebApplication.CreateBuilder(args);

builder.AddApiGaze(options => 
{
    options.ApplicationId = "your-application-id";
    options.Enabled = true;
});

var app = builder.Build();
app.UseApiGaze();
  1. Configure the middleware options:
builder.AddApiGaze(options => 
{
    // Basic configuration
    options.ApplicationId = "your-application-id";
    options.Enabled = true;

    // HTTP capture options
    options.HttpCapture.CaptureRequestBody = true;
    options.HttpCapture.CaptureResponseBody = true;
    options.HttpCapture.CaptureQueryParameters = true;
    options.HttpCapture.CaptureRequestHeaders = true;
    options.HttpCapture.CaptureResponseHeaders = true;
    options.HttpCapture.CaptureExceptionInfo = true;

    // Exclude paths
    options.ExcludedPathPatterns.Add("/health");
    options.ExcludedPathPatterns.Add("/metrics");
    options.ExcludedPathPatterns.Add("/swagger/*");

    // Redaction rules
    options.HttpCapture.RedactionRules.QueryParameterRedactionPatterns.Add("apiKey");
    options.HttpCapture.RedactionRules.HeaderRedactionPatterns.Add("authorization");
    options.HttpCapture.RedactionRules.BodyRedactionPatterns.Add(@"\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b");
});

Beta Status

This is a beta release of ApiGaze. Some features and behaviors may change before the final release. We're particularly interested in feedback on:

  • Configuration options and defaults
  • Performance impact
  • Memory usage
  • Error handling
  • Documentation clarity

Please report any issues or suggestions on our GitHub repository.

Known Limitations

  • Memory usage may be high when capturing large request/response bodies
  • No built-in persistence for telemetry data
  • Limited error handling for external API failures
  • No built-in rate limiting

Configuration Options

ApiGazeOptions

Property Type Default Description
ApplicationId string - Required. Your application identifier from the ApiGaze dashboard
Enabled bool true Whether ApiGaze is enabled
ExcludedPathPatterns HashSet<string> ["/health", "/swagger/*", "/favicon.ico"] Paths to exclude from monitoring

HttpCaptureOptions

Property Type Default Description
CaptureRequestBody bool false Whether to capture request bodies
CaptureResponseBody bool false Whether to capture response bodies
CaptureQueryParameters bool false Whether to capture query parameters
CaptureRequestHeaders bool false Whether to capture request headers
CaptureResponseHeaders bool false Whether to capture response headers
CaptureExceptionInfo bool false Whether to capture exception information
ExcludedPathPatterns HashSet<string> [] Paths to exclude from HTTP capture
RedactionRules RedactionRules new() Rules for redacting sensitive data

Best Practices

  1. Security

    • Always configure redaction rules for sensitive data
    • Exclude health check and metrics endpoints
    • Use appropriate capture settings based on your needs
  2. Performance

    • Enable only the capture options you need
    • Use path exclusions for high-traffic endpoints
    • Monitor memory usage with body capture enabled
  3. Configuration

    • Store sensitive configuration in secure configuration providers
    • Use environment-specific settings
    • Validate configuration in development

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  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 is compatible.  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.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.0.1-alpha2 215 5/6/2025