Use manual tracing when you need explicit control over what gets logged and when.Documentation Index
Fetch the complete documentation index at: https://docs.trynexus.io/llms.txt
Use this file to discover all available pages before exploring further.
How it works
- Create one
NexusClientper request or workflow. - Create nested spans with
client.span(...). - Set outputs or errors on spans.
- Call
client.flush()to persist buffered events.
Minimal example
Span behavior
- A span gets a generated
run_id. - The active parent span becomes
parent_run_idfor children. - Exceptions inside
with client.span(...)mark the span as errored. - Exceptions are re-raised after logging because span context managers do not suppress them.
Choosing event_type
Use categories that map to your architecture:
chainllmchat_modeltoolagentretrievertextretry
Common pitfalls
- Forgetting to call
flush()means events stay in memory. - Passing non-JSON-serializable objects is allowed, but they are converted to strings.