Skip to main content

The SDK that revolutionizes debugging and tracing.

Project description

Testing Status Documentation Discord PyPI Version PyPI SDK Downloads npm version TraceRoot.AI Website X X X LinkedIn WhatsApp Wechat

TraceRoot SDK

TraceRoot SDK is a clean and principled package built upon OpenTelemetry with enhanced debugging and tracing experience. It provides smart logging and tracing with minimal setup and code changes.

Quick Start

You can follow the docs here to get more details and have a deeper understanding of the TraceRoot SDK.

Installation

python3.11 -m venv venv
source venv/bin/activate
pip install traceroot
# or install the latest version from the source code
pip install -e .

Cloud Mode

Cloud mode is to use TraceRoot's cloud service to store the logs and traces.

Prerequisite

For the TraceRoot SDK to work with your application, you need to set up some environment variables with some credentials.

Please visit TraceRoot.AI to get the credentials.

You also need to input following information to traceroot.init(...) at the beginning of your entry file for your Python program to have a full experience:

traceroot.init(
    token="traceroot-********************************",
    service_name="sdk-example-service",
    github_owner="traceroot-ai",
    github_repo_name="traceroot-sdk",
    github_commit_hash="main"
)

Or you can just put them in a yaml file called .traceroot-config.yaml in the root of your project:

token: "traceroot-********************************"
service_name: "sdk-example-service"
github_owner: "traceroot-ai"
github_repo_name: "traceroot-sdk"
github_commit_hash: "main"
  • token is the token for the TraceRoot API.
  • service_name is the name of the service or program you are going to keep track of.
  • github_owner is the owner of the GitHub repository.
  • github_repo_name is the name of the GitHub repository.
  • github_commit_hash is the commit hash of the GitHub repository.

The GitHub information is optional. If you do not provide them, the TraceRoot SDK will not be able to provide you with the GitHub information in the logs.

Local Mode

Local mode is to use TraceRoot's local database to store the logs and traces.

Prerequisite

You need to set up a local database to store the logs and traces by running the jaeger docker container.

Download the Jaeger Docker image:

docker run cr.jaegertracing.io/jaegertracing/jaeger:2.8.0 --help

Run the Jaeger Docker container:

docker stop jaeger || true && docker rm jaeger || true && docker run -d --name jaeger \
  -e COLLECTOR_OTLP_ENABLED=true \
  -p 16686:16686 \
  -p 14268:14268 \
  -p 14250:14250 \
  -p 4317:4317 \
  -p 4318:4318 \
  cr.jaegertracing.io/jaegertracing/jaeger:2.8.0

docker logs -f jaeger

Then you need to use following code to initialize the TraceRoot SDK in local mode:

traceroot.init(
    service_name="sdk-example-service",
    github_owner="traceroot-ai",
    github_repo_name="traceroot-sdk",
    github_commit_hash="main"
    local_mode=True
)

Or you can just put them in a yaml file called .traceroot-config.yaml in the root of your project:

service_name: "sdk-example-service"
github_owner: "traceroot-ai"
github_repo_name: "traceroot-sdk"
github_commit_hash: "main"
local_mode: true

There is an example of using the configuration file for the local mode in the .traceroot-config-local.yaml file.

Other Settings

You can also set the following settings in the .traceroot-config.yaml file:

  • enable_span_console_export: Whether to enable console export and print the spans to the console.
  • enable_log_console_export: Whether to enable console export and print the logs to the console.

Examples

For an end-to-end example that uses the TraceRoot SDK for a multi-agent system, please refer to the Multi-agent System with TraceRoot SDK.

The source code of the multi-agent system example is available in traceroot-examples/examples/multi_agent.

Citation

If you use our exploratory TraceRoot SDK in your research, please cite the following paper:

@article{traceroot_2025,
  title={TraceRoot Is All You Need for Debugging and Tracing},
  author={Zecheng Zhang and Xinwei He},
  year = {2025},
  publisher = {GitHub},
  url = {https://github.com/traceroot-ai/traceroot}
}

Contact Us

Please reach out to founders@traceroot.ai or visit TraceRoot.AI if you do not have these credentials or have any questions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traceroot-0.0.4a9.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traceroot-0.0.4a9-py3-none-any.whl (20.2 kB view details)

Uploaded Python 3

File details

Details for the file traceroot-0.0.4a9.tar.gz.

File metadata

  • Download URL: traceroot-0.0.4a9.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for traceroot-0.0.4a9.tar.gz
Algorithm Hash digest
SHA256 f6bda6889e05b6fc4c5438c555d531fd9e1cdbc631fad44c135a717da68753af
MD5 476cec9f29cba8d952a3b8313e5add48
BLAKE2b-256 5c532663d6c70d855788f3eab81107bb819e8c4b6bcdd99f4e1a47f15192ebd6

See more details on using hashes here.

File details

Details for the file traceroot-0.0.4a9-py3-none-any.whl.

File metadata

  • Download URL: traceroot-0.0.4a9-py3-none-any.whl
  • Upload date:
  • Size: 20.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.12

File hashes

Hashes for traceroot-0.0.4a9-py3-none-any.whl
Algorithm Hash digest
SHA256 8a59658f0e850ccfcfeab0002b4bfdef761945ea4b4fa268e433360b0203baf2
MD5 a5e10799bfc6fc725df57ddced36feb5
BLAKE2b-256 b6546d71fd52e32d4bbc984c7d93a7a7dcbb81026f45726e9480a5cc30c3e8bc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page