LynxTracer
Main telemetry collector.
run(agentName, callback)
Runs code inside a Lynx trace context.
run(options, callback)
Use structured run metadata.
Semantic helpers
| Method | Purpose |
|---|---|
userInput(input, metadata?) | Capture user input. |
decision(reasonOrDecision, options?) | Capture an agent decision. |
context(labelOrData, dataOrMetadata?) | Capture retrieved or constructed context. |
memory(label, payload) | Capture memory access. |
outcome(options) | Capture final session outcome. |
setAttributes(attributes) | Attach attributes to later events in the run. |
annotate(label, payload) | Capture a custom annotation. |
log(label, payload) | Capture a custom context alert. |
Instrumentation helpers
| Method | Purpose |
|---|---|
instrumentLLM(client, options?) | Wrap an LLM client object. |
instrumentTool(name, fn, metadata?) | Wrap a tool function. |
guardTool(name, fn, options) | Wrap a tool with local policy evaluation. |
Delivery helpers
| Method | Purpose |
|---|---|
flush() | Send queued telemetry now. |
shutdown(options?) | Clear timers and flush before exit. |
getStatus() | Read local queue, circuit breaker, and delivery status. |
LynxPolicyError
Thrown when guardTool() blocks a tool call.
lynx
Default tracer configured from environment variables.
new LynxTracer() when you need explicit config per process, tenant, or test.