DEV Community

zintrust Zin
zintrust Zin

Posted on

Know What Happened: Application Tracing with @zintrust/trace

Logs tell you that something failed. Traces tell you what led to it.
@zintrust/trace is an optional observability package for ZinTrust apps. When enabled, it registers watchers for core runtime events and records them as trace entries:

  • Incoming requests
  • Database queries
  • Exceptions
  • Background jobs
  • Cache activity
  • Notifications
  • CLI events
  • Outbound HTTP calls

Entries are stored in your configured database by default, and an optional web dashboard shows them. Install and set up in three steps:

npm install @zintrust/trace
zin migrate:trace
Enter fullscreen mode Exit fullscreen mode

Import '@zintrust/trace/plugin' in 'src/zintrust.plugins.ts' and set TRACE_ENABLED=true to activate tracing. Mount the dashboard in your own routes, or also set TRACE_AUTO_MOUNT=true to use the stock auto-mount flow.

When the relevant trace events and identifiers are captured, inspect a request, its job activity, queries, and outbound calls in the dashboard. What can be connected depends on the instrumentation and context available in your app.

Try it: npm install -g @zintrust/core && zin new my-app

Top comments (0)