Tracing
Tracing records runtime steps such as rendering, parsing, provider calls, stream iteration, and custom application operations.
Register tracers
Section titled “Register tracers”from prompty import PromptyTracer, Tracer, trace
Tracer.add("json", PromptyTracer("./traces").tracer)
@tracedef my_function(): ...import { Tracer, consoleTracer, trace } from "@prompty/core";
Tracer.add("console", consoleTracer);
const myFunction = trace(async () => { // ...}, "myFunction");using Prompty.Core.Tracing;
Tracer.Add("console", name => new ConsoleTracer(name));
var result = await Trace.TraceAsync("my-operation", async emitter =>{ emitter.Add("input", data); return await DoWork();});use prompty::{Tracer, PromptyTracer, console_tracer, trace_async};
Tracer::register("console", console_tracer);
let pt = PromptyTracer::new("./traces");Tracer::register("file", pt.tracer());
let result = trace_async("my-operation", async { // ...}).await;Trace data shapes
Section titled “Trace data shapes”| Type | Description |
|---|---|
| TraceFile | Serialized trace file |
| TraceSpan | One operation span |
| TraceTime | Start, end, and duration metadata |