Documentation Index
Fetch the complete documentation index at: https://docs.m4trix.dev/llms.txt
Use this file to discover all available pages before exploring further.
@m4trix/tracing records LangGraph and LangChain-style callback runs into a portable trace store. Pair it with @m4trix/trace-viewer to inspect traces locally in a browser.
Use it when you want to:
- Debug nested agent, chain, model, tool, and retriever calls
- Keep model inputs and outputs available after a run finishes
- Attach run metadata such as project, environment, tenant, or experiment labels
- Build a custom trace backend behind the same storage interfaces
- View local filesystem traces without wiring up hosted observability first
Core Model
Tracing is made of four pieces:- Tracer implements callback handlers and turns start/end/error events into trace runs.
- TraceStore persists trace structure separately from larger JSON payloads.
- Adapters decide where trace metadata and payloads are stored.
- TraceViewerApi reads stored traces and returns list, tree, and payload data for a UI.
Package Exports
Import tracing primitives from@m4trix/tracing:
TracerTraceStoreTraceViewerApiFsStructureStoreAdapter,FsPayloadStoreAdapterTrace,TraceRun,TraceRunNodeTraceStatus,TraceRunType,TraceTokens,TraceMetadataStructureStoreAdapter,PayloadStoreAdapter,ListTracesQuery
@m4trix/trace-viewer:
createFsTraceViewerApistartTraceViewerServerappRouter,AppRouter,TraceViewerContextparseCliArgs,cliHelpText
Example Project
The repository includes a LangGraph example atexamples/tracing-example. It writes filesystem traces to tmp/tracing-example and can be inspected with the trace viewer: