alepha@docs:~/framework/docs/reference/providers$
cat MemoryTraceProvider.md | pretty
1 min read
Last commit:

#MemoryTraceProvider

#Import

typescript
1import { MemoryTraceProvider } from "alepha/tracing";

#Overview

Keeps finished spans in memory, grouped by trace, for devtools and specs.

A bounded ring: the last maxTraces traces (200), each capped at maxSpansPerTrace spans (1000), the oldest trace dropped first. Never unbounded. Registering it (injecting it) turns recording on and forces sampling to 1.

ts
1const alepha = Alepha.create();2const traces = alepha.inject(MemoryTraceProvider);3await alepha.start();4// ... exercise the app5expect(traces.spans().map((s) => s.name)).toContain("GET /users");