Skip to content

ADR-001: Observability Stack — Serilog + OpenTelemetry

Date: 2026-02-21 Authors: Jean-Francois Meyers Scope: granit-dotnet (Granit.Observability)

The Granit framework provides the Granit.Observability module which encapsulates the configuration of structured logging, distributed tracing and metrics. The choice of instrumentation libraries determines:

  • ISO 27001 traceability: structured timestamped logs retained for 3 years
  • Distributed tracing: request correlation across modules, Wolverine messages and HTTP calls
  • Metrics: performance monitoring and alerting
  • Data sovereignty: no telemetry data must leave European infrastructure

Observability data is exported via the OTLP protocol to a self-hosted Grafana stack: Loki (logs), Tempo (traces), Mimir (metrics).

  • Logging: Serilog (Serilog.AspNetCore + Serilog.Sinks.OpenTelemetry)
  • Tracing & metrics: OpenTelemetry .NET SDK (7 packages)
  • Export: OTLP (OpenTelemetry Protocol) to the Grafana stack

Option 1: Serilog + OpenTelemetry (selected)

Section titled “Option 1: Serilog + OpenTelemetry (selected)”
  • Logging: Serilog — structured logging, enrichers (context, tenant, user), OTLP sink to unify the pipeline
  • Tracing: OpenTelemetry — CNCF standard, automatic instrumentation (ASP.NET Core, HTTP, EF Core), W3C Trace Context propagation
  • Export: OTLP to Loki/Tempo/Mimir (self-hosted in Europe)

Option 2: Microsoft.Extensions.Logging + OpenTelemetry only

Section titled “Option 2: Microsoft.Extensions.Logging + OpenTelemetry only”
  • Advantage: no third-party dependency for logging
  • Disadvantage: limited enrichment, no dedicated sink for advanced structured formats, less flexible configuration than Serilog (namespace filtering, destructuring)
  • Advantage: NLog is mature and performant
  • Disadvantage: less developed OTLP sink ecosystem than Serilog, XML configuration (vs fluent API), modern .NET community leans toward Serilog

Option 4: Application Insights (Azure Monitor)

Section titled “Option 4: Application Insights (Azure Monitor)”
  • Advantage: native .NET integration, out-of-the-box dashboard
  • Disadvantage: incompatible with data sovereignty — data hosted on Azure (US Cloud Act), variable cost based on ingestion volume, vendor lock-in
  • Advantage: complete SaaS solution (logs + traces + metrics + APM)
  • Disadvantage: incompatible with data sovereignty — data outside EU (or EU region but US company subject to Cloud Act), high cost per host/GB
CriterionSerilog + OTelMEL + OTelNLog + OTelApp InsightsDatadog
SovereigntySelf-hostedSelf-hostedSelf-hostedNo (Azure)No (US)
CNCF standardYes (OTel)Yes (OTel)Yes (OTel)PartialPartial
Log enrichmentExcellentBasicGoodGoodExcellent
Native OTLP sinkYesNoPartialN/AN/A
.NET communityVery largeStandardMediumLargeMedium
CostInfra onlyInfra onlyInfra onlyVariableHigh
ISO 27001 complianceYesYesYesRiskRisk
PackageRole
Serilog.AspNetCoreASP.NET Core integration, request enrichers
Serilog.Sinks.OpenTelemetryLog export via OTLP
OpenTelemetryCore SDK
OpenTelemetry.ApiInstrumentation API (ActivitySource, Meter)
OpenTelemetry.Extensions.HostingIHostBuilder integration
OpenTelemetry.Instrumentation.AspNetCoreAutomatic HTTP request traces
OpenTelemetry.Instrumentation.HttpAutomatic HttpClient call traces
OpenTelemetry.Instrumentation.EntityFrameworkCoreAutomatic EF Core query traces
OpenTelemetry.Exporter.OpenTelemetryProtocolOTLP export to Loki/Tempo/Mimir
  • Sovereignty compliance: zero telemetry data leaving European hosting
  • CNCF standard: portability to any OTLP-compatible backend
  • Full correlation: logs, traces, and metrics via the same TraceId
  • Serilog contextual enrichment: tenant, user, module, correlation-id
  • Unified Grafana dashboard for the entire platform
  • Grafana stack maintenance (Loki, Tempo, Mimir) falls on the SRE team
  • Initial configuration more complex than a SaaS solution
  • Serilog is a third-party dependency (maintenance risk, although very stable)

This decision should be re-evaluated if:

  • A European managed observability service emerges (ISO 27001 certified)
  • OpenTelemetry .NET SDK reaches feature parity with Serilog for structured logging
  • The maintenance burden of the self-hosted Grafana stack becomes disproportionate