Docs/Getting started/Quickstart
印 v0.0.2-alpha
Quickstart
Five minutes: install the SDK, start the sidecar, kill your app on purpose, and watch the alert arrive.
HEADS UP
MLWP v1 is not frozen. Between alpha releases, the wire format can change and your stored events may need a re-ingest.
1. Install
npm i @moecorp/moelog-node @moecorp/moelog-sidecar
2. Initialise
app.ts
import { init } from '@moecorp/moelog-node';
init({
app: 'checkout-api',
release: '1.4.2',
environment: process.env.NODE_ENV ?? 'production',
sidecar: {
socketPath: '/var/run/moelog.sock',
},
}); 3. Start the sidecar
terminal
npx moelog-sidecar --daemon
It launches detached, and it shuts itself down 120 seconds after the last client disconnects.
4. Kill it on purpose
simulate crash
kill -9 $(pgrep -f my-app)
死app.crashed/severe checkout-api (SIGKILL)
FP: 7a9e14c0 1s ago
What you should see, about a second later.
Vocabulary
GLOSSARY_INDEX TermDefinition
event An immutable record emitted by your app or the sidecar.
issue A grouping of events sharing the same fingerprint.
fingerprint A deterministic 8-character hex hash classifying the crash.
alert A notification pushed when a critical state transition occurs.
app The logical application identifier declared during initialization.
release Semantic version or git SHA identifying the deployment.
sidecar The detached out-of-process daemon watching your application.
heartbeat Periodic pulse sent over the unix socket to prove liveness.
Last updated 2 days ago edit Edit this page on GitHub