WideEvents is a high-performance structured logging and observability framework for .NET focused on Wide Events and Canonical Log Lines.
Instead of producing dozens of fragmented logs during a request lifecycle, WideEvents captures a single rich, structured event containing operational, technical, and business context.
The goal is simple:
Make production systems easier to understand, debug, query, and observe.
Full documentation lives in docs/, available in English and Portuguese:
Traditional logging was designed for monoliths and local debugging.
Modern distributed systems generate:
- fragmented logs
- duplicated context
- expensive correlation
- noisy observability pipelines
A single HTTP request may produce:
- controller logs
- service logs
- database logs
- retry logs
- integration logs
- exception logs
Reconstructing what happened becomes operational archaeology.
WideEvents changes the model:
Instead of logging every step, emit a single canonical event describing the complete outcome of the request.
Instead of:
Request started
Loading cart
Calling payment provider
Retrying payment
Payment failed
Request finished
WideEvents produces:
{
"duration_ms": 1247,
"status_code": 500,
"outcome": "error",
"payment": {
"method": "card",
"provider": "stripe"
},
"error": {
"type": "PaymentError",
"code": "card_declined"
},
"cart": {
"id": "cart_xyz",
"total_cents": 15999
},
"user": {
"id": "user_456",
"subscription": "premium"
},
"trace_id": "7d3b9c5f7b",
"request_id": "req_8bf7ec2d"
}One event. Full context.
- Structured wide events
- Canonical log lines
- OpenTelemetry integration
- Automatic trace/span correlation
- Structured nested JSON output
- Adaptive sampling
- PII masking/sanitization
- Async exporter pipeline
- Source-generated schemas
- Minimal allocations
- Extensible exporters
- ASP.NET Core middleware
- Kafka-ready architecture
- High-throughput serialization options
HTTP Request
↓
Middleware
↓
Scopes + Activity Context
↓
Wide Event Builder
↓
Structured Event
↓
Export Pipeline
WideEvents integrates with:
- ILogger
- OpenTelemetry
- Serilog
- OTLP collectors
- Kafka pipelines
- Structured JSON logging platforms
dotnet add package WideEvents.Coredotnet add package WideEvents.AspNetCoredotnet add package WideEvents.OpenTelemetrybuilder.Services.AddWideEvents(options =>
{
options.EnableOpenTelemetry = true;
});app.UseWideEvents();WideEvent.Add("user.id", user.Id);
WideEvent.Add("cart.total_cents", cart.TotalCents);WideEvents supports hierarchical structured events.
WideEvent.Add("payment.method", "card");
WideEvent.Add("payment.provider", "stripe");Produces:
{
"payment": {
"method": "card",
"provider": "stripe"
}
}WideEvents automatically integrates with OpenTelemetry Activities.
Captured automatically:
- trace_id
- span_id
- activity tags
Example:
builder.Services.AddWideEvents(options =>
{
options.EnableOpenTelemetry = true;
});Define strongly typed event schemas.
[WideEventSchema]
public partial record CheckoutEvent
{
public string UserId { get; init; }
public decimal Total { get; init; }
}Generated automatically:
event.Enrich();No reflection required.
WideEvents supports asynchronous exporters.
Current architecture supports:
- OpenTelemetry / OTLP
- Kafka
- Custom exporters
Example:
public class MyExporter : IWideEventExporter
{
public Task ExportAsync(
IReadOnlyDictionary<string, object?> evt,
CancellationToken ct)
{
return Task.CompletedTask;
}
}WideEvents was designed with performance as a first-class concern.
Available serialization modes:
- Source-generated
System.Text.Json - Span-based pooled JSON writer
- Minimal allocation pipelines
The framework avoids:
- runtime reflection
- blocking I/O
- synchronous exporters
- unnecessary allocations
WideEvents supports adaptive sampling.
Example policy:
- always keep errors
- always keep slow requests
- probabilistic sampling for successful requests
WideEvents includes sanitization hooks for:
- PII masking
- sensitive field filtering
- compliance strategies
These capabilities are essential for modern observability pipelines where logs may contain business, customer, or regulated data.
Typical use cases include:
- GDPR compliance
- PCI DSS environments
- internal security policies
- audit and governance requirements
- multi-tenant SaaS platforms
WideEvents allows organizations to centralize sanitization policies before events reach external systems such as Kafka, OTLP collectors, SIEMs, or analytics platforms.
Example:
{
"user": {
"email": "***"
}
}WideEvents is not "just logging".
It treats observability as structured operational data.
The framework is heavily inspired by:
- Canonical Log Lines
- Wide Events
- Modern distributed observability practices
- High-cardinality event pipelines
- https://loggingsucks.com/
- https://stripe.com/blog/canonical-log-lines
WideEvents is being designed as a long-term observability platform for modern .NET systems.
Planned evolutions include:
- ClickHouse exporter
- Loki integration
- Metrics integration
- Dashboard templates
- Native OpenTelemetry Logs support
- Native AOT optimizations
- Zero-allocation serialization pipelines
- Advanced pooling strategies
- Benchmark suite
- Dynamic sampling
- Schema registry
- Centralized masking policies
- Compliance-aware exporters
- Roslyn analyzers
dotnet newtemplates- Visual Studio tooling
- Event schema validation
Contributions, ideas, discussions, and experiments are welcome.
This project is focused on building practical observability tooling for modern .NET systems.
Licensed under the Apache License 2.0.