Documentation
¶
Overview ¶
Package stats-observer demonstrates how to use stats.ValidationObserver and stats.ReportErrors with codecs directly — without any HTTP or MQTT adapter.
This is the codec-only observability path: implement just stats.ValidationObserver (one method) and call stats.ReportErrors after each codex.Codec.Decode.
Scenario: an application validates its config file on startup. Invalid config fields emit stats.RecordValidationError events that a production observer would route to Prometheus counters, structured logs, or alerting.
Run with: go run ./examples/stats-observer
Click to show internal directories.
Click to hide internal directories.