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.8.tar.gz.

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_traceloop-0.1.8.tar.gz
Algorithm Hash digest
SHA256 e56027ddadffed3b22c4db7f6bffccd1e846ae728ee4e285f8cdebe07092ca81
MD5 053c280fb9611bb16567a1a45e8b7a9c
BLAKE2b-256 d4fc542cbe42d8ae2d3e71f7c2140144026801b64403693879c6dc657f577d2f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for splunk_otel_util_genai_translator_traceloop-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b39a7c8269b799cf55d80627b2ea0361159b7b86eb0555d3951be52555fa7ff7
MD5 225d0e3e9999b7bd779ab066c3ba8620
BLAKE2b-256 dfd39405dd5291a141fc90857bcfd9a810c6f19be5930170e2b443d95f810d3c

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