Observability is a first-class concern in TaskHub.Shared. Every service is instrumented for logs, metrics, and traces out of the box, with a single shared backend (Loki + Prometheus + Tempo, all behind Grafana).
FullHostBuilder wires the full observability stack β opting in is the default, opting out is explicit.TraceId lives in every related log line, every span, and every metric exemplar. Click in Grafana, see the full picture.prometheus-net backed implementation with /metrics endpoint. βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Your Service β
β β
β Serilog ββββΊ Loki (logs, enriched with TraceId) β
β Activity βββΊ Tempo (spans, the request shape) β
β Prometheus ββΊ Prometheus (counters/gauges/histograms) β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
Grafana (single pane)
The shared TraceId makes the three signals click together in Grafana β go from a slow histogram bucket to the actual log lines of the offending request in two clicks.
| Question | Use |
|---|---|
| βWhat happened in this one request?β | Logs (with TraceId filter) |
| βHowβs the system doing right now?β | Metrics (rates, latencies, error rates) |
| βWhere is this request spending its time?β | Traces (Tempo span waterfall) |
| βDid the rate of failures change?β | Metrics + alerts |
| βWhy did this request fail?β | Trace β linked logs |
The FullHostBuilder registers the whole stack:
new FullHostBuilder(args).Start<MyDbContext>();
// Includes: AddAppSerilog() + AddAppMetrics() + AddAppOpenTelemetry()
For services using BasicHostBuilder, opt in module by module β see each moduleβs usage doc.