traceroot.config.ts
file in the root of your project:
token
is required and you can generate one from the TraceRoot.AI platform integration page.enable_span_console_export
and enable_log_console_export
are optional and you can enable them to see the spans and logs in the console. We recommend to not enable span console export as it make the terminal output too verbose.local_mode
is optional and you can enable it to store all data locally, which is using the Jaeger backend and SQlite for data storage. More details please checkout our open sourced traceroot project.traceroot.config.ts
file:
traceroot.config.ts
file, you need to ensure you have TypeScript installed so that the SDK can correctly parse the config file. An example is shown in this package.json file:
traceroot.traceFunction
, function name, service name, environment, and logging.
traceroot.traceFunction
to trace your functions. We require that you at least need to call this function to the entry point of your application.
For example, if you have a workflow called, you can wrap around your workflow with this to allow to track tracing information.
If you add more traceroot.traceFunction
to the children function of the parent function, the tracing information will have a nicer tree structure, which allows better performance of the AI agents to analyze the tracing and logging information.
spanName
parameter, the span name will be used as the name of the function that will be shown in the TraceRoot.AI platform.
traceroot.traceFunction
, you can use the traceroot logger to log the information, including logger.info
, logger.error
, logger.warn
, logger.debug
and logger.critical
.
Notice that within the traceroot.traceFunction
, the log will be correctly tracked and you can see the log in the TraceRoot.AI platform by clicking each workflows of the tracing information.
Here is an example of how to use the traceroot.traceFunction
and the logger
:
traceroot.traceFunction
, you can replace it with the decorator such as @traceroot.trace({ spanName: 'greet' })
: