Observability
Shared host helpers for JSON logs, HTTP correlation, and optional OpenTelemetry. Not a fourth suite “engine” — libraries the cores use so operators get the same shape everywhere.
| Package | Role | Used by |
|---|---|---|
| OxyKit.Observability | JSON console logging + X-Correlation-Id | Render, Mail, Flow |
| OxyKit.OpenTelemetry | Optional OTLP traces + metrics (off by default) | Mail, Flow only |
Repo: oxykit-dev/OxyKit.Observability · NuGet: OxyKit.Observability · OxyKit.OpenTelemetry
Render does not reference OxyKit.OpenTelemetry (thin sidecar / AOT-size). No Serilog or Sentry SDKs in the cores.
Correlation
Every host accepts or generates X-Correlation-Id, echoes it on the response, and includes it in log scopes.
| Behavior | Detail |
|---|---|
| Inbound | Send X-Correlation-Id; omitted → host generates a value |
| Response | Same header always echoed |
| Flow jobs | Background work sets an ambient id and propagates it to Render and Mail HTTP |
Logs
Outside Development (including Compose Production), hosts write JSON to stdout (docker compose logs). Force with Logging:JsonConsole / Logging__JsonConsole (true / false).
App code stays on ILogger<T> message templates — no Serilog façade.
Optional OpenTelemetry (Mail + Flow)
Off unless you opt in:
| Enable with | Notes |
|---|---|
OpenTelemetry:Enabled=true | Or OpenTelemetry__Enabled=true |
OTEL_EXPORTER_OTLP_ENDPOINT | Standard OTel env; also enables export |
OTEL_SERVICE_NAME | Optional override of OpenTelemetry:ServiceName |
Exports OTLP traces + metrics (ASP.NET Core, HttpClient, runtime, plus product Activity/Meter names such as OxyKit.Mail / OxyKit.Flow). Logs stay on stdout JSON this wave.
Commented examples live in the suite-root .env.example compose env template.
Host wiring (integrators of the APIs)
Callers only need the correlation header for support. Host builders (or forkers) use:
builder.AddOxyKitJsonConsole();
app.UseOxyKitCorrelation();
// Mail / Flow only:
builder.AddOxyKitOpenTelemetry(o =>
{
o.ServiceName = "OxyKit.Mail";
o.ActivitySources = ["OxyKit.Mail"];
o.Meters = ["OxyKit.Mail"];
});See also Local compose and each product overview.