Skip to content

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.

PackageRoleUsed by
OxyKit.ObservabilityJSON console logging + X-Correlation-IdRender, Mail, Flow
OxyKit.OpenTelemetryOptional 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.

BehaviorDetail
InboundSend X-Correlation-Id; omitted → host generates a value
ResponseSame header always echoed
Flow jobsBackground 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 withNotes
OpenTelemetry:Enabled=trueOr OpenTelemetry__Enabled=true
OTEL_EXPORTER_OTLP_ENDPOINTStandard OTel env; also enables export
OTEL_SERVICE_NAMEOptional 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:

csharp
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.

Render · Mail · Flow