Highlights
Designed for teams that want practical application insight without standing up a full observability stack on day one.
Automatic ASP.NET Core request logging
Secure built-in Razor Class Library dashboard
Request detail drawer with headers, correlation IDs, trace IDs, exceptions, dependencies, and hierarchy
Feature and module usage analytics
Metrics for request volume, latency, percentiles, status codes, and error rate
Manual logging, metrics, tracing, feature tracking, and dependency tracking APIs
Sensitive data redaction before storage, export, dashboard display, or AI context
In-memory storage, JSON file storage, JSON and CSV export, SMTP alerts, and AI provider abstraction
Installation
dotnet add package Algos.Insights
<ProjectReference Include="..\src\Algos.Insights\Algos.Insights.csproj" />
Quick start
using Algos.Insights.Extensions;
using Algos.Insights.Options;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddAlgosInsights(options =>
{
options.ApplicationName = "My Production API";
options.EnvironmentName = builder.Environment.EnvironmentName;
options.EnableAutomaticRequestLogging = true;
options.EnableRequestBodyLogging = false;
options.EnableResponseBodyLogging = false;
options.MaxBodySizeInBytes = 4096;
options.IgnoreRoutes = new[]
{
"/myinsights",
"/favicon.ico"
};
options.Storage.UseInMemory(memory =>
{
memory.MaxRequestLogs = 10000;
memory.MaxExceptionLogs = 5000;
memory.RetentionHours = 48;
});
options.Dashboard.Enabled = true;
options.Dashboard.Route = "/myinsights";
options.Dashboard.Title = "Algos Insights";
options.Dashboard.AuthMode = AlgosInsightsAuthMode.Basic;
options.Dashboard.Username = builder.Configuration["AlgosInsights:Username"];
options.Dashboard.Password = builder.Configuration["AlgosInsights:Password"];
options.Dashboard.EnableDataExport = true;
});
var app = builder.Build();
app.UseAlgosInsights();
app.MapAlgosInsightsDashboard("/myinsights", dashboard =>
{
dashboard.RequireBasicAuth("admin", "strong-password");
dashboard.Title = "Algos Insights";
});
app.Run();
Open the dashboard at /myinsights.
Dashboard
The dashboard is delivered as a Razor Class Library area. Consuming applications do not need to copy views, JavaScript, or CSS files.
Routes
/myinsights
/myinsights/requests
/myinsights/features
/myinsights/exceptions
/myinsights/dependencies
/myinsights/traces
Capabilities
- Overview health score and request explorer
- Method, status, search, and sort controls
- Trace ID and correlation ID copy buttons
- Request hierarchy, modules, features, dependencies, exceptions
- JSON and CSV exports
The dashboard does not auto-poll. It loads once and refreshes when the user clicks Refresh.
What gets captured
HTTP method, path, query string, status code, duration
Request size, response size, client IP, user agent
Authenticated user name when available
Trace ID, span ID, parent span ID, correlation ID
Route name, controller/action, endpoint metadata
Redacted request and response headers
Optional request body
Optional response body
Exceptions, dependencies, traces, and feature usage
Request and response body logging are disabled by default.
Manual telemetry
Inject IAlgosInsightsLogger to track scopes, feature usage, events, metrics, and dependency calls.
using Algos.Insights.Logging;
public sealed class PaymentService
{
private readonly IAlgosInsightsLogger _insights;
public PaymentService(IAlgosInsightsLogger insights)
{
_insights = insights;
}
public async Task ProcessPaymentAsync()
{
using var scope = _insights.BeginScope("PaymentProcessing", new
{
Module = "Payments",
Feature = "StripeCheckout"
});
_insights.TrackFeatureUsage("Payments", "StripeCheckout", new
{
PaymentType = "Card",
Currency = "USD"
});
_insights.TrackEvent("PaymentStarted", new
{
Amount = 100,
Currency = "USD"
});
_insights.TrackMetric("payment.amount", 100, new
{
Currency = "USD"
});
await _insights.TrackDependencyAsync("Stripe API", "CreatePaymentIntent", async () =>
{
await Task.Delay(120);
});
}
}
Feature usage
_insights.TrackFeatureUsage("Billing", "Invoice Download");
using Algos.Insights.Models;
app.MapPost("/api/payments/stripe", () => Results.Ok())
.WithMetadata(new AlgosFeatureAttribute("Payments", "Stripe Checkout"));
Storage and exports
options.Storage.UseInMemory(memory =>
{
memory.MaxRequestLogs = 10000;
memory.MaxExceptionLogs = 5000;
memory.RetentionHours = 48;
});
options.Storage.UseJsonFile(json =>
{
json.DirectoryPath = "App_Data/AlgosInsights";
});
Protected export routes
/myinsights/export/requests.json
/myinsights/export/requests.csv
Export output is limited by Dashboard.MaxExportRows.
Security
Security defaults are intentionally conservative.
Request body logging is off by default
Response body logging is off by default
Dashboard route is excluded from request logging
Sensitive headers and fields are masked
AI is disabled by default
Exports require dashboard authentication
password, token, authorization, cookie, set-cookie, otp, secret,
access_token, refresh_token, card, cvv, api_key, connectionstring
options.Redaction.MaskFields = new[]
{
"password",
"token",
"authorization",
"cookie",
"secret",
"api_key"
};
Health checks
/health is ignored by default because most production systems call health endpoints very frequently.
options.IgnoreRoutes = new[]
{
"/myinsights",
"/favicon.ico"
};
Alerts
Configure SMTP alert rules with windows, thresholds, cooldowns, and email delivery.
options.EmailAlerts.ConfigureSmtp(smtp =>
{
smtp.Enabled = true;
smtp.Host = builder.Configuration["Smtp:Host"];
smtp.Port = 587;
smtp.Username = builder.Configuration["Smtp:Username"];
smtp.Password = builder.Configuration["Smtp:Password"];
smtp.From = "alerts@myapp.com";
smtp.To = new[] { "admin@myapp.com" };
});
options.Alerts.AddRule(rule =>
{
rule.Name = "Repeated 500 Errors";
rule.WhenStatusCodeIs = 500;
rule.TriggerWhenCountGreaterThan = 10;
rule.WindowMinutes = 5;
rule.CooldownMinutes = 20;
rule.SendEmail = true;
});
AI assistant
AI is disabled by default. The package currently exposes an AI provider abstraction for future integrations. AI context must be redacted before use, and API keys are never displayed in the dashboard.
public interface IAlgosAiProvider
{
Task<AlgosAiResponse> AskAsync(
AlgosAiRequest request,
CancellationToken cancellationToken = default);
}
OpenAI-compatible APIs
Azure OpenAI
Custom HTTP endpoints
Local LLM endpoints
Architecture
src/
Algos.Insights/
Areas/
AlgosInsights/
Pages/
Index.cshtml
Requests.cshtml
Features.cshtml
Exceptions.cshtml
Dependencies.cshtml
Traces.cshtml
Dashboard/
Assets/
Endpoints/
Security/
Middleware/
Models/
Options/
Logging/
Storage/
Export/
Alerts/
AI/
Redaction/
samples/
Algos.Insights.SampleApi/
Sample API
dotnet run --project samples/Algos.Insights.SampleApi/Algos.Insights.SampleApi.csproj
Open: /myinsights
Username: admin
Password: strong-password
Production recommendations
Use strong dashboard credentials
Serve the dashboard only over HTTPS
Keep body logging disabled unless diagnosing a specific issue
Keep retention bounded
Exclude noisy routes unless you really need them
Disable exports in sensitive environments if required
Store dashboard credentials in configuration or secret storage
Treat AI output as advisory only
Roadmap
OpenTelemetry exporter integration
Azure Application Insights and Azure Monitor providers
AWS CloudWatch provider
SQL Server, PostgreSQL, SQLite, MongoDB storage providers
Elasticsearch/OpenSearch provider
Rich trace waterfall UI
Alert history dashboard
Webhook, Slack, and Teams alert providers
AI chat provider implementations
Role/policy-based dashboard authorization
NuGet
Algos.Insights
Source