Traceloop -> GenAI translator emitter for OpenTelemetry GenAI
Project description
This package automatically translates Traceloop-instrumented spans into OpenTelemetry GenAI semantic conventions. It intercepts spans with traceloop.* attributes and creates corresponding spans with gen_ai.* attributes, enabling seamless integration between Traceloop instrumentation and GenAI observability tools.
Mapping Table
Traceloop Key |
Added Key |
|---|---|
traceloop.workflow.name |
gen_ai.workflow.name |
traceloop.entity.name |
gen_ai.agent.name |
traceloop.entity.path |
gen_ai.workflow.path |
traceloop.correlation.id |
gen_ai.conversation.id |
traceloop.entity.input |
gen_ai.input.messages |
traceloop.entity.output |
gen_ai.output.messages |
Installation
pip install opentelemetry-util-genai-traceloop-translator
Quick Start
The translator automatically registers when Traceloop is initialized. See the examples for complete usage:
Basic Example: examples/traceloop_processor_example.py - Demonstrates workflow, agent, task, and tool decorators with automatic span translation.
Evaluation Example: examples/traceloop_eval_example.py - Shows how to run GenAI evaluations on translated spans.
# Run basic example
python examples/traceloop_processor_example.py
# Run evaluation example
python examples/traceloop_eval_example.py
Evaluations
In order to enable GenAI evaluations for Traceloop spans, the corresponding packages must be installed:
# install evaluation packages
pip install opentelemetry-util-genai-evals opentelemetry-util-genai-evals-deepeval
Also, see .env.example for environment variable setup, which includes setting up configuration for the evaluation provider.
The translator enables GenAI evaluations by converting Traceloop spans to the standardized gen_ai.* format. Once translated, LLM / Agent spans can be evaluated using metrics like:
Answer Relevancy - How relevant is the response to the input
Faithfulness - Is the response grounded in context
Bias/Toxicity - Content safety checks
Evaluations require a compatible evaluation provider (e.g., DeepEval). See examples/traceloop_eval_example.py for a complete example.
Tests
To run the test suite, use the following command: .. code-block:: bash
pytest util/opentelemetry-util-genai-traceloop-translator/tests
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file splunk_otel_util_genai_translator_traceloop-0.1.7.tar.gz.
File metadata
- Download URL: splunk_otel_util_genai_translator_traceloop-0.1.7.tar.gz
- Upload date:
- Size: 43.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.11.14 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7794697c8409fa62edc407b3c8c2eb15451516faf1ce0008648f7f9a6b06ad17
|
|
| MD5 |
3dc6dd1031b20916e023738f6351ee16
|
|
| BLAKE2b-256 |
7c4a52d556efad046efeeb877ce5a8c6d687172bc3c7e9bf6f1d85f4721aabf6
|
File details
Details for the file splunk_otel_util_genai_translator_traceloop-0.1.7-py3-none-any.whl.
File metadata
- Download URL: splunk_otel_util_genai_translator_traceloop-0.1.7-py3-none-any.whl
- Upload date:
- Size: 29.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: Hatch/1.16.3 cpython/3.11.14 HTTPX/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9b2797d6c6911df05ac5e4a232c15d90953ea5ebf52e88a8f8656232910f74ae
|
|
| MD5 |
f49afb32c03277a8fcc52da0ceb97f5e
|
|
| BLAKE2b-256 |
b84309ef6d8d51034d63d310430c869e033bc9cfc8dc0959056422740eaee4d4
|