Requirements: .NET 8+
Installation
Quick start
- ASP.NET Core (recommended)
- Console / Worker apps (non-DI)
1
Register Tracelit in Program.cs
Program.cs
2
You're done
The SDK wires up traces, logs, and metrics automatically. No middleware needed.
Configuration reference
Custom resource attributes
Tracing
Manual spans
Use the static façade — works in both DI and non-DI apps afterStart() is called:
In ASP.NET Core (DI-injected ActivitySource)
Automatic instrumentation
Metrics
Counter
Histogram
Gauge
Automatic metrics collection
Log forwarding
When usingAddTracelit(), all ILogger output is forwarded to the Tracelit logs table via OTLP. Log records are automatically correlated to the active span via trace_id + span_id.
Sampling and error guarantee
Error spans are always exported, even when the parent trace falls outside the sample ratio. The SDK uses a custom
ErrorAlwaysOnSampler + ErrorSpanProcessor pair — no configuration required.