Reference
@muze-nl/metro-trace reference
Scoped tracing
Prefer scoped tracing for application code. The tracer only sees requests made by that client and nested requests made through context.fetch() or context.trace.options().
add(name, tracer)
Adds a global tracer. Global tracers see all Metro clients.
delete(name) / remove(name)
Removes a named global tracer.
clear()
Removes all global tracers.
group()
Creates a small tracer that logs request and response steps with console.group().
graph(options)
Creates a graph tracer that records spans, diagnostics, events, nested Metro calls, and request failures. In browsers it can use localStorage, which makes it useful for redirect and popup flows that return to the same origin.
Common options include view, autoPrint, console, store, storage, and prefix.
Trace object methods available in middleware
The trace API supports event(name, data), diagnostic(data), span(name, fn, data), current(), link(key), and options(extra).
localConsole(options)
Creates the console adapter used by the graph tracer.
GraphTracer
Class behind graph(). Most code should use graph().