Bellwether. Event
(bellwether v0.1.0)
Copy Markdown
Turning what Bellwether.Reporter emits into what the Agent socket accepts.
The Reporter deals in payloads: a shaped cause, a stacktrace, a Fingerprint, a count. An Event additionally needs a Domain and a Kind, and those are this module's whole job.
What it deliberately does not supply is identity — the Event id, the boot it happened in, and the milliseconds since that boot. The Agent stamps all three on receipt, because an Adapter runs inside a process that may not survive long enough to mint an id, has no way to know the boot id, and keeps a monotonic clock with a different base from the Agent's. An Adapter that guessed would attribute a crash to the wrong boot.
Summary
Functions
Convert one Reporter emission.
Four shapes arrive here, and they are not the same Event:
%{kind: :repeat}, the count of what dedupe collapsed while the window was open;%{kind: :blocked}, the count of what an operator's blocklist silenced;- anything already carrying a
:domain, which a caller built itself and which passes through untouched; - a crash payload, which becomes an
otpcrash.
The first two are agent Events, not otp ones. They are Bellwether
reporting on itself, and grouping them with the fault they describe would
make an Issue's count include the times it was deliberately not reported.