macula_diagnostics (macula v3.13.0)
View SourceStructured event emission + per-process metric accumulation.
Phase 1 implementation: events go through OTP logger with a structured report; metrics live in the calling process's dictionary. Phase 7 upgrades to Prometheus / OpenTelemetry exporters without changing this module's public surface.
Topic namespacing convention:
_macula.*— protocol-layer events (SDK)_hecate.*— station-layer events (Hecate-specific)
Summary
Functions
Emit a structured event at the default info level.
Emit a structured event at a specific level.
Emit a metric. counter increments are summed across calls; gauge values overwrite the previous reading.
Drop all metric entries from the calling process's dictionary.
Snapshot all metrics held by the calling process.
Types
-type level() :: debug | info | notice | warning | error.
-type metric_type() :: counter | gauge.
-type sample() :: {Name :: binary(), metric_type(), number()}.
Functions
Emit a structured event at the default info level.
Emit a structured event at a specific level.
-spec metric(binary(), metric_type(), number()) -> ok.
Emit a metric. counter increments are summed across calls; gauge values overwrite the previous reading.
-spec reset() -> ok.
Drop all metric entries from the calling process's dictionary.
-spec snapshot() -> [sample()].
Snapshot all metrics held by the calling process.