Observability Example

August 2, 2026 ยท View on GitHub

This example uses the in-memory noop broker, so it needs no Docker service or credentials. All new observability is off unless the master -observe switch is present.

go run ./examples/observability
go run ./examples/observability -observe -logs
go run ./examples/observability -observe -health -diagnostics
go run ./examples/observability -observe -metrics -correlation -events
go run ./examples/observability -observe -all -scenario=handler-failure
SwitchPurpose
-observeMaster opt-in switch
-allEnable every category
-logsStructured failure records
-healthPassive local health
-diagnosticsSafe diagnostic snapshot
-metricsBounded operation measurements
-correlationPublish-to-handler context propagation
-eventsLifecycle and failure events
-probeExplicit active probe; requires -health
-scenarionormal, connect-failure, publish-failure, or handler-failure
-timeoutBound scenario and probe waiting; default 5s

Category flags without -observe are rejected. Diagnostic output never prints message bodies, raw connection strings, or correlation values. Synthetic failures are deterministic teaching aids and do not retry or alter acknowledgment behavior.