.traceroot-config.yaml
file in the root of your project:
TRACEROOT_
. For example, you can set the TRACEROOT_TOKEN
environment variable to the token
for the TraceRoot API.
You can run following example to see how to use the environment variables:
traceroot.init(...)
parameters.traceroot-config.yaml
file.traceroot-config.yaml
file will be overridden.
Configuration Parameters:
token
- The token for the TraceRoot API (required for cloud mode)service_name
- The name of the service or program you are trackinggithub_owner
- The owner of the GitHub repository (optional)github_repo_name
- The name of the GitHub repository (optional)github_commit_hash
- The commit hash of the GitHub repository (optional)enable_span_cloud_export
- Enable/disable cloud export of spans (default: true
)enable_log_cloud_export
- Enable/disable cloud export of logs (default: true
)enable_span_console_export
- Enable/disable console export of spans (default: false
)enable_log_console_export
- Enable/disable console export of logs (default: true
).traceroot-config.yaml
file if it exists. And then if you call traceroot.init(...)
with any parameters, the parameters will override the configuration in the .traceroot-config.yaml
file.
.traceroot-config.yaml
file:
enable_span_cloud_export
: If set to false
, disables cloud export of spans (also disables cloud export of logs)enable_log_cloud_export
: If set to false
, only disables cloud export of logsenable_span_console_export
: Enable to print spans to consoleenable_log_console_export
: Enable to print logs to console@traceroot.trace()
decorator to trace your functions. You should at least trace the entry point of your application. Adding more @traceroot.trace()
decorators to child functions creates a better tree structure for analysis.
name
parameter in the decorator, it will be used as the span name shown in the TraceRoot.AI platform.
logger.info
, logger.error
, logger.warn
, logger.debug
, and logger.critical
. Logs within traced functions are properly tracked and visible in the TraceRoot.AI platform.
Here is an example of how to use the @traceroot.trace()
decorator and logger: