How to initialize Agensight tracing, define main operations with @trace, and add granular details with @span.
:information_source: Note on Sessions:Example:
- If both init() and @trace() specify a session, the @trace() value takes precedence for that specific trace.
- If you pass only a string (e.g. session=“user_123”), it is treated as a session_id.
- To improve traceability, you can pass a full dictionary: id, name, user_id.
Supplying a full dict{id, name, user_id}
improves tracking and grouping but is optional. Before any traces or spans can be created, you must initialize the Agensight tracing system usinginit()
— typically once at the beginning of your application.