FUNCTIONS / @SPFN/MONITOR — ERROR TRACKING, LOGGING & ADMIN DASHBOARD

See it
running.

Errors deduplicated into fingerprinted groups, developer logs in a pluggable store, a superadmin dashboard on top — all persisted in your own database. @spfn/monitor wires in through defineServerConfig() and one package router, and notifies Slack by group state, not by event count.

Read the reference Get started $ pnpm add @spfn/monitor
01
The premise

Your errors are rows
in your database.

A production error shouldn't vanish into a log stream. This package persists it: error groups, individual events, and developer logs land as rows in the spfn_monitor Postgres schema of the database you already run — queryable through six superadmin API routes, rendered by ready-made React components. Integration is three points on defineServerConfig() — an onError middleware, a lifecycle, and monitorRouter mounted with .packages([...]), so its /_monitor/admin/* routes are served but stay out of your app's client types.

onError middleware
lifecycle
.packages([monitorRouter])
spfn_monitor schema
FIG 01 — THREE INTEGRATION POINTS · MIGRATIONS SHIP WITH THE PACKAGE
02
Core technique

One group,
one notification.

Every tracked error is fingerprinted — SHA-256 over name, message, and path, cut to 16 hex chars. Same triple, same group. Slack then follows the group's state, not the event count: a new fingerprint creates a group and posts once; while the group is active or ignored, further occurrences only increment the count and record an event; mark it resolved, and the next occurrence reopens the group and posts again. The concrete property: the channel carries one message per new or reopened problem, while every single occurrence is still on record in the DB. And if Slack or the event write fails, the failure is caught and logged — it never breaks the response.

error ≥ minStatusCode
SHA-256(name:message:path)
group state check
slack on new / reopened
FIG 02 — 16-HEX FINGERPRINT · ACTIVE = COUNT ONLY · TRACKING NEVER BREAKS THE RESPONSE
03
What's inside

The parts you'd otherwise
build again.

Watch it run.