Skip to main content

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:

# 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

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

File details

Details for the file splunk_otel_util_genai_translator_traceloop-0.1.7.tar.gz.

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_traceloop-0.1.7.tar.gz
Algorithm Hash digest
SHA256 7794697c8409fa62edc407b3c8c2eb15451516faf1ce0008648f7f9a6b06ad17
MD5 3dc6dd1031b20916e023738f6351ee16
BLAKE2b-256 7c4a52d556efad046efeeb877ce5a8c6d687172bc3c7e9bf6f1d85f4721aabf6

See more details on using hashes here.

File details

Details for the file splunk_otel_util_genai_translator_traceloop-0.1.7-py3-none-any.whl.

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_traceloop-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 9b2797d6c6911df05ac5e4a232c15d90953ea5ebf52e88a8f8656232910f74ae
MD5 f49afb32c03277a8fcc52da0ceb97f5e
BLAKE2b-256 b84309ef6d8d51034d63d310430c869e033bc9cfc8dc0959056422740eaee4d4

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