Metadata-Version: 2.4
Name: genai-otel-instrument
Version: 1.36.1
Summary: Comprehensive OpenTelemetry auto-instrumentation for LLM/GenAI applications
Author-email: Kshitij Thakkar <kshitijthakkar@rocketmail.com>
License: Apache-2.0
Project-URL: Homepage, https://github.com/Mandark-droid/genai_otel_instrument
Project-URL: Repository, https://github.com/Mandark-droid/genai_otel_instrument
Project-URL: Documentation, https://mandark-droid.github.io/genai_otel_instrument/
Project-URL: Issues, https://github.com/Mandark-droid/genai_otel_instrument/issues
Project-URL: Changelog, https://github.com/Mandark-droid/genai_otel_instrument/blob/main/CHANGELOG.md
Keywords: opentelemetry,observability,llm,genai,instrumentation,tracing,metrics,monitoring,ai-agents,openai,anthropic,langchain,crewai,auto-instrumentation,cost-tracking,gpu-metrics,mcp,model-context-protocol,llm-observability,ai-observability
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: opentelemetry-api<2.0.0,>=1.20.0
Requires-Dist: opentelemetry-sdk<2.0.0,>=1.20.0
Requires-Dist: opentelemetry-instrumentation>=0.41b0
Requires-Dist: opentelemetry-semantic-conventions>=0.45b0
Requires-Dist: opentelemetry-exporter-otlp>=1.20.0
Requires-Dist: wrapt>=1.14.0
Provides-Extra: openinference
Requires-Dist: openinference-instrumentation<1.0.0,>=0.1.31; extra == "openinference"
Requires-Dist: openinference-instrumentation-litellm<1.0.0,>=0.1.19; extra == "openinference"
Requires-Dist: openinference-instrumentation-mcp<2.0.0,>=1.3.0; extra == "openinference"
Requires-Dist: openinference-instrumentation-smolagents<1.0.0,>=0.1.11; extra == "openinference"
Requires-Dist: litellm!=1.82.7,!=1.82.8,>=1.0.0; extra == "openinference"
Provides-Extra: typesafe
Requires-Dist: typesafe-sdk>=0.6.0; python_version >= "3.10" and extra == "typesafe"
Provides-Extra: strands
Requires-Dist: strands-harness>=0.1.1; python_version >= "3.10" and extra == "strands"
Provides-Extra: antigravity
Requires-Dist: google-antigravity>=0.1.20; python_version >= "3.10" and extra == "antigravity"
Provides-Extra: http
Requires-Dist: requests>=2.20.0; extra == "http"
Requires-Dist: httpx>=0.23.0; extra == "http"
Requires-Dist: opentelemetry-instrumentation-requests>=0.41b0; extra == "http"
Requires-Dist: opentelemetry-instrumentation-httpx>=0.41b0; extra == "http"
Provides-Extra: evaluation
Requires-Dist: presidio-analyzer>=2.2.0; extra == "evaluation"
Requires-Dist: presidio-anonymizer>=2.2.0; extra == "evaluation"
Requires-Dist: spacy>=3.0.0; extra == "evaluation"
Requires-Dist: detoxify>=0.5.0; extra == "evaluation"
Requires-Dist: google-api-python-client>=2.0.0; extra == "evaluation"
Provides-Extra: gpu
Requires-Dist: nvidia-ml-py>=11.495.46; extra == "gpu"
Requires-Dist: codecarbon>=2.3.0; extra == "gpu"
Provides-Extra: amd-gpu
Requires-Dist: amdsmi>=7.0.0; extra == "amd-gpu"
Requires-Dist: codecarbon>=2.3.0; extra == "amd-gpu"
Provides-Extra: all-gpu
Requires-Dist: nvidia-ml-py>=11.495.46; extra == "all-gpu"
Requires-Dist: amdsmi>=7.0.0; extra == "all-gpu"
Requires-Dist: codecarbon>=2.3.0; extra == "all-gpu"
Provides-Extra: co2
Requires-Dist: codecarbon>=2.3.0; extra == "co2"
Provides-Extra: openai
Requires-Dist: openai>=1.0.0; extra == "openai"
Provides-Extra: openrouter
Requires-Dist: openai>=1.0.0; extra == "openrouter"
Provides-Extra: cometapi
Requires-Dist: openai>=1.0.0; extra == "cometapi"
Requires-Dist: anthropic>=0.18.0; extra == "cometapi"
Provides-Extra: anthropic
Requires-Dist: anthropic>=0.18.0; extra == "anthropic"
Provides-Extra: google
Requires-Dist: google-generativeai>=0.3.0; extra == "google"
Provides-Extra: aws
Requires-Dist: boto3>=1.28.0; extra == "aws"
Provides-Extra: azure
Requires-Dist: openai>=1.0.0; extra == "azure"
Provides-Extra: azure-ai-inference
Requires-Dist: azure-ai-inference>=1.0.0; extra == "azure-ai-inference"
Provides-Extra: cohere
Requires-Dist: cohere>=4.0.0; extra == "cohere"
Provides-Extra: mistral
Requires-Dist: mistralai>=0.4.2; extra == "mistral"
Provides-Extra: together
Requires-Dist: together>=0.2.0; extra == "together"
Provides-Extra: groq
Requires-Dist: groq>=0.4.0; extra == "groq"
Provides-Extra: llamacpp
Requires-Dist: llama-cpp-python>=0.2.0; extra == "llamacpp"
Provides-Extra: ollama
Requires-Dist: ollama>=0.1.0; extra == "ollama"
Provides-Extra: vllm
Requires-Dist: vllm>=0.6.0; extra == "vllm"
Provides-Extra: replicate
Requires-Dist: replicate>=0.15.0; extra == "replicate"
Provides-Extra: sambanova
Requires-Dist: sambanova>=1.0.0; extra == "sambanova"
Provides-Extra: sarvamai
Requires-Dist: sarvamai>=0.1.0; extra == "sarvamai"
Provides-Extra: elevenlabs
Requires-Dist: elevenlabs>=1.0.0; extra == "elevenlabs"
Provides-Extra: liquid-audio
Requires-Dist: liquid-audio>=1.2.0; extra == "liquid-audio"
Provides-Extra: langchain
Requires-Dist: langchain>=0.1.0; extra == "langchain"
Provides-Extra: langgraph
Requires-Dist: langgraph>=0.1.0; extra == "langgraph"
Provides-Extra: llamaindex
Requires-Dist: llama-index>=0.9.0; extra == "llamaindex"
Provides-Extra: huggingface
Requires-Dist: transformers>=4.30.0; extra == "huggingface"
Requires-Dist: sentence-transformers>=2.2.0; extra == "huggingface"
Provides-Extra: sentence-transformers
Requires-Dist: sentence-transformers>=2.2.0; extra == "sentence-transformers"
Provides-Extra: crewai
Requires-Dist: crewai>=0.1.0; extra == "crewai"
Provides-Extra: autogen
Requires-Dist: pyautogen<0.10.0,>=0.2.0; extra == "autogen"
Provides-Extra: autogen-agentchat
Requires-Dist: autogen-agentchat>=0.4.0; extra == "autogen-agentchat"
Provides-Extra: google-adk
Requires-Dist: google-adk>=1.17.0; extra == "google-adk"
Provides-Extra: haystack
Requires-Dist: haystack-ai>=2.0.0; extra == "haystack"
Provides-Extra: dspy
Requires-Dist: dspy-ai>=2.0.0; extra == "dspy"
Provides-Extra: guardrails
Requires-Dist: guardrails-ai>=0.4.0; extra == "guardrails"
Provides-Extra: instructor
Requires-Dist: instructor>=1.0.0; extra == "instructor"
Provides-Extra: pydantic-ai
Requires-Dist: pydantic-ai>=0.0.1; extra == "pydantic-ai"
Provides-Extra: vertexai
Requires-Dist: google-cloud-aiplatform>=1.0.0; extra == "vertexai"
Provides-Extra: databases
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.41b0; extra == "databases"
Requires-Dist: sqlalchemy>=1.4.0; extra == "databases"
Requires-Dist: opentelemetry-instrumentation-redis>=0.41b0; extra == "databases"
Requires-Dist: redis; extra == "databases"
Requires-Dist: opentelemetry-instrumentation-pymongo>=0.41b0; extra == "databases"
Requires-Dist: pymongo; extra == "databases"
Requires-Dist: opentelemetry-instrumentation-psycopg2>=0.41b0; extra == "databases"
Requires-Dist: psycopg2-binary>=2.9.0; extra == "databases"
Requires-Dist: opentelemetry-instrumentation-mysql>=0.41b0; extra == "databases"
Requires-Dist: mysql-connector-python>=9.1.0; extra == "databases"
Requires-Dist: pika>=1.0.0; extra == "databases"
Requires-Dist: minio>=7.0.0; extra == "databases"
Requires-Dist: opensearch-py>=2.0.0; extra == "databases"
Requires-Dist: opentelemetry-instrumentation-opensearch-py>=0.41b0; extra == "databases"
Requires-Dist: elasticsearch>=7.0.0; extra == "databases"
Requires-Dist: opentelemetry-instrumentation-elasticsearch>=0.41b0; extra == "databases"
Provides-Extra: messaging
Requires-Dist: opentelemetry-instrumentation-kafka-python>=0.41b0; extra == "messaging"
Requires-Dist: kafka-python; extra == "messaging"
Requires-Dist: pika>=1.0.0; extra == "messaging"
Provides-Extra: falkordb
Requires-Dist: falkordb>=1.0.0; extra == "falkordb"
Provides-Extra: vector-dbs
Requires-Dist: pinecone>=3.0.0; extra == "vector-dbs"
Requires-Dist: weaviate-client>=3.0.0; extra == "vector-dbs"
Requires-Dist: qdrant-client>=1.0.0; extra == "vector-dbs"
Requires-Dist: chromadb>=0.4.0; extra == "vector-dbs"
Requires-Dist: pymilvus>=2.3.0; extra == "vector-dbs"
Requires-Dist: faiss-cpu>=1.7.0; extra == "vector-dbs"
Requires-Dist: lancedb>=0.6.0; extra == "vector-dbs"
Provides-Extra: object-storage
Requires-Dist: minio>=7.0.0; extra == "object-storage"
Provides-Extra: multimodal-images
Requires-Dist: Pillow>=10.0.0; extra == "multimodal-images"
Provides-Extra: multimodal-pdf
Requires-Dist: pypdf>=4.0.0; extra == "multimodal-pdf"
Provides-Extra: multimodal-faces
Requires-Dist: opencv-python-headless>=4.8.0; extra == "multimodal-faces"
Provides-Extra: multimodal-s3
Requires-Dist: boto3>=1.28.0; extra == "multimodal-s3"
Provides-Extra: multimodal
Requires-Dist: Pillow>=10.0.0; extra == "multimodal"
Requires-Dist: pypdf>=4.0.0; extra == "multimodal"
Requires-Dist: opencv-python-headless>=4.8.0; extra == "multimodal"
Requires-Dist: boto3>=1.28.0; extra == "multimodal"
Requires-Dist: azure-ai-inference>=1.0.0; extra == "multimodal"
Provides-Extra: all-providers
Requires-Dist: openai>=1.0.0; extra == "all-providers"
Requires-Dist: anthropic>=0.18.0; extra == "all-providers"
Requires-Dist: google-generativeai>=0.3.0; extra == "all-providers"
Requires-Dist: boto3>=1.28.0; extra == "all-providers"
Requires-Dist: azure-ai-inference>=1.0.0; extra == "all-providers"
Requires-Dist: cohere>=4.0.0; extra == "all-providers"
Requires-Dist: mistralai>=0.4.2; extra == "all-providers"
Requires-Dist: together>=0.2.0; extra == "all-providers"
Requires-Dist: groq>=0.4.0; extra == "all-providers"
Requires-Dist: ollama>=0.1.0; extra == "all-providers"
Requires-Dist: replicate>=0.15.0; extra == "all-providers"
Requires-Dist: sambanova>=1.0.0; extra == "all-providers"
Requires-Dist: sarvamai>=0.1.0; extra == "all-providers"
Requires-Dist: elevenlabs>=1.0.0; extra == "all-providers"
Requires-Dist: langchain>=0.1.0; extra == "all-providers"
Requires-Dist: langgraph>=0.1.0; extra == "all-providers"
Requires-Dist: llama-index>=0.9.0; extra == "all-providers"
Requires-Dist: transformers>=4.30.0; extra == "all-providers"
Requires-Dist: sentence-transformers>=2.2.0; extra == "all-providers"
Requires-Dist: liquid-audio>=1.2.0; extra == "all-providers"
Requires-Dist: litellm!=1.82.7,!=1.82.8,>=1.0.0; extra == "all-providers"
Requires-Dist: typesafe-sdk>=0.6.0; python_version >= "3.10" and extra == "all-providers"
Requires-Dist: strands-harness>=0.1.1; python_version >= "3.10" and extra == "all-providers"
Requires-Dist: crewai>=0.1.0; extra == "all-providers"
Requires-Dist: pyautogen<0.10.0,>=0.2.0; extra == "all-providers"
Requires-Dist: autogen-agentchat>=0.4.0; extra == "all-providers"
Requires-Dist: google-adk>=1.17.0; extra == "all-providers"
Requires-Dist: haystack-ai>=2.0.0; extra == "all-providers"
Requires-Dist: dspy-ai>=2.0.0; extra == "all-providers"
Requires-Dist: guardrails-ai>=0.4.0; extra == "all-providers"
Requires-Dist: instructor>=1.0.0; extra == "all-providers"
Requires-Dist: pydantic-ai>=0.0.1; extra == "all-providers"
Requires-Dist: google-cloud-aiplatform>=1.0.0; extra == "all-providers"
Provides-Extra: all-mcp
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.41b0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-redis>=0.41b0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-pymongo>=0.41b0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-psycopg2>=0.41b0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-mysql>=0.41b0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-kafka-python>=0.41b0; extra == "all-mcp"
Requires-Dist: pinecone>=3.0.0; extra == "all-mcp"
Requires-Dist: weaviate-client>=3.0.0; extra == "all-mcp"
Requires-Dist: qdrant-client>=1.0.0; extra == "all-mcp"
Requires-Dist: chromadb>=0.4.0; extra == "all-mcp"
Requires-Dist: pymilvus>=2.3.0; extra == "all-mcp"
Requires-Dist: faiss-cpu>=1.7.0; extra == "all-mcp"
Requires-Dist: lancedb>=0.6.0; extra == "all-mcp"
Requires-Dist: sqlalchemy; extra == "all-mcp"
Requires-Dist: minio>=7.0.0; extra == "all-mcp"
Requires-Dist: opensearch-py>=2.0.0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-opensearch-py>=0.41b0; extra == "all-mcp"
Requires-Dist: elasticsearch>=7.0.0; extra == "all-mcp"
Requires-Dist: opentelemetry-instrumentation-elasticsearch>=0.41b0; extra == "all-mcp"
Requires-Dist: falkordb>=1.0.0; extra == "all-mcp"
Provides-Extra: all
Requires-Dist: openai>=1.0.0; extra == "all"
Requires-Dist: anthropic>=0.18.0; extra == "all"
Requires-Dist: google-generativeai>=0.3.0; extra == "all"
Requires-Dist: boto3>=1.28.0; extra == "all"
Requires-Dist: cohere>=4.0.0; extra == "all"
Requires-Dist: mistralai>=0.4.2; extra == "all"
Requires-Dist: together>=0.2.0; extra == "all"
Requires-Dist: groq>=0.4.0; extra == "all"
Requires-Dist: ollama>=0.1.0; extra == "all"
Requires-Dist: replicate>=0.15.0; extra == "all"
Requires-Dist: sambanova>=1.0.0; extra == "all"
Requires-Dist: sarvamai>=0.1.0; extra == "all"
Requires-Dist: elevenlabs>=1.0.0; extra == "all"
Requires-Dist: langchain>=0.1.0; extra == "all"
Requires-Dist: langgraph>=0.1.0; extra == "all"
Requires-Dist: llama-index>=0.9.0; extra == "all"
Requires-Dist: transformers>=4.30.0; extra == "all"
Requires-Dist: sentence-transformers>=2.2.0; extra == "all"
Requires-Dist: liquid-audio>=1.2.0; extra == "all"
Requires-Dist: typesafe-sdk>=0.6.0; python_version >= "3.10" and extra == "all"
Requires-Dist: strands-harness>=0.1.1; python_version >= "3.10" and extra == "all"
Requires-Dist: nvidia-ml-py>=11.495.46; extra == "all"
Requires-Dist: amdsmi>=7.0.0; extra == "all"
Requires-Dist: codecarbon>=2.3.0; extra == "all"
Requires-Dist: crewai>=0.1.0; extra == "all"
Requires-Dist: pyautogen<0.10.0,>=0.2.0; extra == "all"
Requires-Dist: autogen-agentchat>=0.4.0; extra == "all"
Requires-Dist: google-adk>=1.17.0; extra == "all"
Requires-Dist: haystack-ai>=2.0.0; extra == "all"
Requires-Dist: dspy-ai>=2.0.0; extra == "all"
Requires-Dist: guardrails-ai>=0.4.0; extra == "all"
Requires-Dist: instructor>=1.0.0; extra == "all"
Requires-Dist: pydantic-ai>=0.0.1; extra == "all"
Requires-Dist: google-cloud-aiplatform>=1.0.0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-redis>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-pymongo>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-psycopg2>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-mysql>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-kafka-python>=0.41b0; extra == "all"
Requires-Dist: pinecone>=3.0.0; extra == "all"
Requires-Dist: weaviate-client>=3.0.0; extra == "all"
Requires-Dist: qdrant-client>=1.0.0; extra == "all"
Requires-Dist: chromadb>=0.4.0; extra == "all"
Requires-Dist: pymilvus>=2.3.0; extra == "all"
Requires-Dist: faiss-cpu>=1.7.0; extra == "all"
Requires-Dist: lancedb>=0.6.0; extra == "all"
Requires-Dist: minio>=7.0.0; extra == "all"
Requires-Dist: opensearch-py>=2.0.0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-opensearch-py>=0.41b0; extra == "all"
Requires-Dist: elasticsearch>=7.0.0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-elasticsearch>=0.41b0; extra == "all"
Requires-Dist: sqlalchemy; extra == "all"
Requires-Dist: presidio-analyzer>=2.2.0; extra == "all"
Requires-Dist: presidio-anonymizer>=2.2.0; extra == "all"
Requires-Dist: spacy>=3.0.0; extra == "all"
Requires-Dist: detoxify>=0.5.0; extra == "all"
Requires-Dist: google-api-python-client>=2.0.0; extra == "all"
Requires-Dist: requests>=2.20.0; extra == "all"
Requires-Dist: httpx>=0.23.0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-requests>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-httpx>=0.41b0; extra == "all"
Requires-Dist: mysql-connector-python>=9.1.0; extra == "all"
Requires-Dist: psycopg2-binary>=2.9.0; extra == "all"
Requires-Dist: redis; extra == "all"
Requires-Dist: pymongo; extra == "all"
Requires-Dist: sqlalchemy>=1.4.0; extra == "all"
Requires-Dist: kafka-python; extra == "all"
Requires-Dist: pika>=1.0.0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-mysql>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-psycopg2>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-redis>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-pymongo>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-sqlalchemy>=0.41b0; extra == "all"
Requires-Dist: opentelemetry-instrumentation-kafka-python>=0.41b0; extra == "all"
Requires-Dist: falkordb>=1.0.0; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: mcp>=1.0.0; python_version >= "3.10" and extra == "dev"
Requires-Dist: black>=26.3.1; python_version >= "3.10" and extra == "dev"
Requires-Dist: black<26,>=25.11.0; python_version < "3.10" and extra == "dev"
Requires-Dist: isort>=5.12.0; extra == "dev"
Requires-Dist: pylint>=2.17.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Requires-Dist: build>=0.10.0; extra == "dev"
Requires-Dist: twine>=4.0.0; extra == "dev"
Dynamic: license-file

# TraceVerde

<div align="center">
  <img src="https://raw.githubusercontent.com/Mandark-droid/genai_otel_instrument/main/.github/images/Logo.jpg" alt="TraceVerde Logo" width="400"/>

  **The most comprehensive OpenTelemetry auto-instrumentation library for LLM/GenAI applications**

  *Trace from OpenTelemetry traces. Verde meaning green - for sustainable, transparent AI observability.*

  [Documentation](https://mandark-droid.github.io/genai_otel_instrument/) | [Examples](https://github.com/Mandark-droid/genai_otel_instrument/tree/main/examples) | [Discord](https://discord.gg/6SVz6VKK) | [PyPI](https://pypi.org/project/genai-otel-instrument/)
</div>

<br/>

<div align="center">

[![PyPI version](https://badge.fury.io/py/genai-otel-instrument.svg)](https://badge.fury.io/py/genai-otel-instrument)
[![Python Versions](https://img.shields.io/pypi/pyversions/genai-otel-instrument.svg)](https://pypi.org/project/genai-otel-instrument/)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Downloads](https://static.pepy.tech/badge/genai-otel-instrument)](https://pepy.tech/project/genai-otel-instrument)
[![Downloads/Month](https://static.pepy.tech/badge/genai-otel-instrument/month)](https://pepy.tech/project/genai-otel-instrument)
[![GitHub Stars](https://img.shields.io/github/stars/Mandark-droid/genai_otel_instrument?style=social)](https://github.com/Mandark-droid/genai_otel_instrument)
[![OpenTelemetry](https://img.shields.io/badge/OpenTelemetry-1.20%2B-blueviolet)](https://opentelemetry.io/)
[![CI/CD](https://img.shields.io/badge/CI%2FCD-GitHub%20Actions-2088FF?logo=github-actions&logoColor=white)](https://github.com/Mandark-droid/genai_otel_instrument/actions)
[![Listed in Context Engineering](https://img.shields.io/badge/Listed%20in-Context%20Engineering%20AI%20ecosystem-2e7d32)](https://bonigarcia.dev/context-engineering/ai-ecosystem.html)

</div>

---

## Get Started in 30 Seconds

```bash
pip install genai-otel-instrument
```

```python
import genai_otel
genai_otel.instrument()

# Your existing code works unchanged - traces, metrics, and costs are captured automatically
import openai
client = openai.OpenAI()
response = client.chat.completions.create(model="gpt-4o-mini", messages=[{"role": "user", "content": "Hello!"}])
```

That's it. No wrappers, no decorators, no config files. Every LLM call, database query, and agent interaction is automatically traced with full cost breakdown.

### Let your coding agent do it

Using an AI coding agent or assistant? Paste this prompt into it, in the repository you want instrumented. It adds the two lines above in the right place, installs the right extras, configures through environment variables, and verifies the result with a real run. The same prompt is in the [docs](https://mandark-droid.github.io/genai_otel_instrument/getting-started/coding-agents/).

<details>
<summary>Copy the prompt</summary>

```text
Add OpenTelemetry tracing for LLM calls to this Python application using TraceVerde.

Package on PyPI: genai-otel-instrument      Import name: genai_otel
Docs: https://mandark-droid.github.io/genai_otel_instrument/

Steps

1. Find the entry point of every process this application starts: the module that
   runs first (CLI main, ASGI/WSGI app module, worker start-up script, the first cell
   of a notebook).

2. Find which LLM SDKs and agent frameworks the code imports, for example openai,
   anthropic, langchain, langgraph, crewai, pydantic_ai, autogen_agentchat. Install
   the package with the matching extras and add it to the project's dependency file
   (requirements.txt, pyproject.toml, or whatever this project uses):

       pip install "genai-otel-instrument[openai,langgraph]"

   Extras are named after the library: openai, anthropic, google, langchain,
   langgraph, crewai, pydantic-ai, autogen-agentchat, llamaindex, and others listed
   in the docs. Plain "pip install genai-otel-instrument" is enough when the SDK is
   already a dependency of this project.

3. At the very top of each entry point, add:

       import genai_otel
       genai_otel.instrument()

   This must run before any LLM SDK or agent framework is imported, and before any
   client, LLM or agent object is created. A client created earlier is not traced.
   Call it once per process. Do not wrap, decorate or otherwise change existing LLM
   calls: instrumentation is automatic.

4. Configure through environment variables, not code. Add them wherever this project
   keeps its configuration (.env.example, deployment manifests, the README):

       OTEL_SERVICE_NAME=<a name for this service>
       OTEL_EXPORTER_OTLP_ENDPOINT=<OTLP/HTTP endpoint, for example http://localhost:4318>
       OTEL_EXPORTER_OTLP_HEADERS=<key1=val1,key2=val2, only if the backend needs auth>

   Never hard-code endpoints, API keys or headers. Leave content capture off, which
   is the default: GENAI_ENABLE_CONTENT_CAPTURE=true records prompts and completions
   on spans, so only turn it on if I ask for it.

5. Only if I ask for it:
   - limit what is instrumented: GENAI_ENABLED_INSTRUMENTORS=openai,langgraph
   - sample traces: GENAI_SAMPLING_RATE=0.5

6. Verify with a real run. Run the smallest path of the application that makes an
   LLM call, with OTEL_EXPORTER_OTLP_ENDPOINT set to an empty string for that run.
   Spans are then printed to the console instead of exported. Check that:
   - there is one span per LLM call, carrying gen_ai.request.model,
     gen_ai.usage.input_tokens and gen_ai.usage.output_tokens, and
     gen_ai.usage.cost.total when the model has a known price;
   - if an agent framework is used, its spans are the parents of the LLM spans, in
     the same trace.
   Then restore the real endpoint.

7. Report back: the files you changed, the install line, the environment variables to
   set, and the span names you saw in step 6. If you could not verify something, say
   so instead of assuming it works.

Rules

- Make the smallest change that works. Do not refactor unrelated code.
- Do not add a second LLM tracing library next to this one. If one is already
  present, or the application already sets up its own OpenTelemetry TracerProvider,
  stop and ask me how to proceed.
- If an agent framework ships its own tracing, leave it off unless I ask; running
  both reports every model request twice.
- Do not commit secrets, and do not print or log API keys.
```

</details>

## Why TraceVerde?

| Feature | TraceVerde | OpenLIT | Traceloop/OpenLLMetry | Langfuse | Galileo | Arize (Phoenix) | Opik (Comet) |
|---------|-----------|---------|----------------------|----------|---------|-----------------|--------------|
| Zero-code setup | Yes | Yes | Yes | SDK required | SDK required | SDK / auto (OpenInference) | SDK required |
| LLM providers | 26 | 25+ | 15+ | Via integrations | Via integrations | Via integrations | Via integrations |
| Multi-agent frameworks | 9 (CrewAI, LangGraph, ADK, Antigravity, AutoGen, OpenAI Agents, Pydantic AI, etc.) | Limited | Limited | Limited | Limited | Limited | Limited |
| Cost tracking | Automatic (1,700+ models) | Manual config | Manual config | Manual config | Yes | Yes | Yes |
| GPU metrics (NVIDIA + AMD) | Yes | No | No | No | No | No | No |
| MCP tool instrumentation | Yes (databases, caches, vector DBs, queues) | Limited | Limited | No | No | No | No |
| Evaluation (PII, toxicity, bias, hallucination, prompt injection) | Built-in (6 detectors) | No | No | Separate service | Extensive (core focus) | Built-in (Phoenix evals) | Built-in (core focus) |
| OpenTelemetry native | Yes | Yes | Yes | Partial | Partial | Yes (OpenInference) | Partial |
| Self-hosted / on-prem | Yes (fully local) | Yes | Yes | Yes | Enterprise tier | Yes (Phoenix) | Yes |
| License | Apache-2.0 | Apache-2.0 | Apache-2.0 | MIT | Proprietary | Open-source + Commercial | Apache-2.0 |

## What Gets Instrumented?

### LLM Providers (26+)
OpenAI, OpenRouter, CometAPI, Anthropic, Google AI, Google GenAI, AWS Bedrock, Azure OpenAI, Cohere, Mistral AI, Together AI, Groq, Ollama, vLLM, llama.cpp, Vertex AI, Replicate, HuggingFace, SambaNova, Sarvam AI, ElevenLabs, Hyperbolic, LiteLLM, TypeSafe AI / Jev

[See all providers with examples >>](https://mandark-droid.github.io/genai_otel_instrument/guides/llm-providers/)

### Multi-Agent Frameworks (8)
CrewAI, LangGraph, Google ADK, AutoGen, AutoGen AgentChat, OpenAI Agents SDK, Pydantic AI, AWS Bedrock Agents

[See all frameworks with examples >>](https://mandark-droid.github.io/genai_otel_instrument/guides/multi-agent-frameworks/)

### MCP Tools (20+)
**Databases:** PostgreSQL, MySQL, MongoDB, SQLAlchemy, TimescaleDB, OpenSearch, Elasticsearch, FalkorDB
**Caching:** Redis | **Queues:** Kafka, RabbitMQ | **Storage:** MinIO
**Vector DBs:** Pinecone, Weaviate, Qdrant, ChromaDB, Milvus, FAISS, LanceDB

[See all MCP tools >>](https://mandark-droid.github.io/genai_otel_instrument/guides/mcp-tools/)

### Built-in Evaluation (6 Detectors)
PII Detection (GDPR/HIPAA/PCI-DSS), Toxicity Detection, Bias Detection, Prompt Injection Detection, Restricted Topics, Hallucination Detection

[See all evaluation features with examples >>](https://mandark-droid.github.io/genai_otel_instrument/guides/evaluation/)

## Screenshots

<div align="center">
  <img src="https://raw.githubusercontent.com/Mandark-droid/genai_otel_instrument/main/.github/images/Screenshots/Traces_OpenAI.png" alt="OpenAI Traces" width="800"/>
  <p><em>OpenAI traces with token usage, costs, and latency</em></p>
</div>

<details>
<summary>More screenshots</summary>

### Ollama (Local LLM)
<div align="center">
  <img src="https://raw.githubusercontent.com/Mandark-droid/genai_otel_instrument/main/.github/images/Screenshots/Traces_Ollama.png" alt="Ollama Traces" width="800"/>
</div>

### SmolAgents with Tool Calls
<div align="center">
  <img src="https://raw.githubusercontent.com/Mandark-droid/genai_otel_instrument/main/.github/images/Screenshots/Traces_SmolAgent_with_tool_calls.png" alt="SmolAgent Traces" width="800"/>
</div>

### GPU Metrics
<div align="center">
  <img src="https://raw.githubusercontent.com/Mandark-droid/genai_otel_instrument/main/.github/images/Screenshots/GPU_Metrics.png" alt="GPU Metrics" width="800"/>
</div>

### OpenSearch Dashboard
<div align="center">
  <img src="https://raw.githubusercontent.com/Mandark-droid/genai_otel_instrument/main/.github/images/Screenshots/GENAI_OpenSearch_output.png" alt="OpenSearch Dashboard" width="800"/>
</div>

</details>

## Key Features

### Automatic Cost Tracking

1,700+ models across 40+ providers with per-request cost breakdown. Supports differential pricing (prompt vs completion), reasoning tokens, cache pricing, and custom model pricing.

```python
# Cost tracking is enabled by default - just instrument and go
genai_otel.instrument()

# Or add custom pricing for proprietary models
export GENAI_CUSTOM_PRICING_JSON='{"chat":{"my-model":{"promptPrice":0.001,"completionPrice":0.002}}}'
```

[Cost tracking guide >>](https://mandark-droid.github.io/genai_otel_instrument/guides/cost-tracking/)

### GPU Metrics (NVIDIA + AMD)

Real-time monitoring of utilization, memory, temperature, power, PCIe throughput, throttling, and ECC errors. Multi-GPU aggregate metrics included.

```bash
pip install genai-otel-instrument[gpu]      # NVIDIA
pip install genai-otel-instrument[amd-gpu]  # AMD
```

[GPU metrics guide >>](https://mandark-droid.github.io/genai_otel_instrument/guides/gpu-metrics/)

### Multi-Agent Tracing

Complete span hierarchy for agent frameworks with automatic context propagation:

```
Crew Execution
  +-- Agent: Senior Researcher (gpt-4)
  |     +-- Task: Research OpenTelemetry
  |           +-- openai.chat.completions (tokens: 1250, cost: $0.03)
  +-- Agent: Technical Writer (ollama:llama2)
        +-- Task: Write blog post
              +-- ollama.chat (tokens: 890, cost: $0.00)
```

### Multimodal Observability (v1.1.0)

First-class capture of image, audio, video, and document content parts on
OpenAI, Anthropic, Google Gemini, and Groq spans, and of the audio on Sarvam and
ElevenLabs speech calls (the audio sent for transcription, the audio text-to-speech
returns; the transcript and spoken text follow content capture). Bytes are offloaded
to your configured object store (MinIO / S3 / filesystem / HTTP) and referenced from
spans by URI — they never appear inline in span attributes.

```bash
# Opt in (default is off — text-only behaviour is byte-identical to 1.0.x)
export GENAI_OTEL_MEDIA_CAPTURE_MODE=full
export GENAI_OTEL_MEDIA_STORE=minio
export GENAI_OTEL_MEDIA_STORE_ENDPOINT=http://localhost:9000
export GENAI_OTEL_MEDIA_STORE_ACCESS_KEY=...
export GENAI_OTEL_MEDIA_STORE_SECRET_KEY=...
# Optional: plug in a redactor before upload
export GENAI_OTEL_MEDIA_REDACTOR=genai_otel.media.redactors.face_blur
```

Spans get two co-emitted representations of the same multimodal content:

- A **flat, queryable attribute namespace** — `gen_ai.prompt.{n}.content.{m}.{type, media_uri, media_mime_type, media_byte_size, media_source}` plus a `gen_ai.completion.*` mirror — for backends that index on flat attributes.
- The **upstream-canonical `gen_ai.input.messages` / `gen_ai.output.messages` JSON** conforming to the [gen-ai message schemas](https://github.com/open-telemetry/semantic-conventions-genai/blob/main/docs/gen-ai/gen-ai-input-messages.json) in the dedicated `semantic-conventions-genai` repo, including the `document` modality standardised by our upstream PR #142, plus the optional `byte_size` and `stripped_reason` shapes proposed in #143 / #144 (see [Standards Contributions](#opentelemetry-standards-contributions) below).

[Multimodal guide >>](https://mandark-droid.github.io/genai_otel_instrument/guides/multimodal/)

### Safety & Evaluation

```python
genai_otel.instrument(
    enable_pii_detection=True,       # GDPR/HIPAA/PCI-DSS compliance
    enable_toxicity_detection=True,  # Perspective API + Detoxify
    enable_bias_detection=True,      # 8 bias categories
    enable_prompt_injection_detection=True,
    enable_hallucination_detection=True,
    enable_restricted_topics=True,
)
```

[Evaluation guide with 50+ examples >>](https://mandark-droid.github.io/genai_otel_instrument/guides/evaluation/)

## Configuration

```bash
# Required
export OTEL_SERVICE_NAME=my-llm-app
export OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318

# Optional
export GENAI_ENABLE_GPU_METRICS=true
export GENAI_ENABLE_COST_TRACKING=true
export GENAI_SAMPLING_RATE=0.5                    # Reduce volume in production
export GENAI_ENABLED_INSTRUMENTORS=openai,crewai  # Select specific instrumentors
```

[Full configuration reference >>](https://mandark-droid.github.io/genai_otel_instrument/getting-started/configuration/)

## Backend Integration

Works with any OpenTelemetry-compatible backend:

Jaeger, Zipkin, Prometheus, Grafana, Datadog, New Relic, Honeycomb, AWS X-Ray, Google Cloud Trace, Elastic APM, Splunk, SigNoz, self-hosted OTel Collector

Pre-built [Grafana dashboard templates](https://github.com/Mandark-droid/genai_otel_instrument/tree/main/dashboards) included.

## Examples

90+ ready-to-run examples covering every provider, framework, and evaluation feature:

```
examples/
+-- openai/              # OpenAI chat, embeddings
+-- anthropic/           # Anthropic + PII/toxicity detection
+-- ollama/              # Local models + all evaluation features
+-- crewai_example.py    # Multi-agent crew orchestration
+-- langgraph_example.py # Stateful graph workflows
+-- google_adk_example.py # Google Agent Development Kit
+-- antigravity/          # Google Antigravity SDK agent turns
+-- autogen_example.py   # Microsoft AutoGen agents
+-- pii_detection/       # 10 PII examples (GDPR, HIPAA, PCI-DSS)
+-- toxicity_detection/  # 8 toxicity examples
+-- bias_detection/      # 8 bias examples (hiring compliance, etc.)
+-- prompt_injection/    # 6 injection defense examples
+-- hallucination/       # 4 hallucination detection examples
+-- ...                  # And many more
```

[Browse all examples >>](https://github.com/Mandark-droid/genai_otel_instrument/tree/main/examples)

## OpenTelemetry Standards Contributions

TraceVerde isn't only a consumer of OpenTelemetry GenAI semantic conventions — production gaps surfaced by the library are being upstreamed back into the spec, and one is now part of the standard. Proposals on [`open-telemetry/semantic-conventions-genai`](https://github.com/open-telemetry/semantic-conventions-genai):

| PR | Proposal | Status |
|---|---|---|
| [**#142**](https://github.com/open-telemetry/semantic-conventions-genai/pull/142) | Add `document` to the `Modality` enum on `BlobPart` / `FilePart` / `UriPart` — PDFs, DOCX, and other non-image/video/audio payloads currently fall through to the free-form `string` branch. BFSI KYC extraction is a high-volume real example. | **Merged** 2026-05-16 |
| [**#143**](https://github.com/open-telemetry/semantic-conventions-genai/pull/143) | Add optional `byte_size` on the three media-part types so consumers get a uniform handle on payload size whether the content was carried inline, by URI, or by provider file id — useful for cost-of-capture telemetry and storage planning. Pydantic `ge=0` → JSON schema `"minimum": 0`. | Open — reference scenarios for `FilePart` / `UriPart` requested |
| [**#144**](https://github.com/open-telemetry/semantic-conventions-genai/pull/144) | Make `content` / `file_id` / `uri` optional and add a free-form `stripped_reason` (`size_exceeded`, `modality_not_allowed`, `redactor_error`, `upload_error`, `no_store_configured`) so an instrumentation can fail-closed — record that it observed a media part but intentionally did not capture its bytes — while preserving the original part `type` and `modality`. Enforced via a top-level `anyOf` so structurally-empty parts cannot validate. | Open — with reviewers |

All three were migrated from the closed [`open-telemetry/semantic-conventions#3673`](https://github.com/open-telemetry/semantic-conventions/pull/3673) after the GenAI conventions split into the dedicated repo on 2026-05-05. Each PR ships under the new repo's V2 Weaver schema with the corresponding `models.ipynb` updates and `make check-policies` / `make generate-all` validation.

TraceVerde already emits this shape on the wire, providing the reference implementation for these conventions. Since v1.10.0 the GenAI semconv tier is opted into by default (`OTEL_SEMCONV_STABILITY_OPT_IN` defaults to `gen_ai/dup`), so spans carry both the current and the superseded attribute spellings.

## Ecosystem & Framework Contributions

Beyond the spec, `genai_otel` is shipping **inside agent frameworks** as their OpenTelemetry observability layer — in-tree where the project accepts it, or as a standalone plugin where the project's policy keeps integrations out of the core tree — demonstrating the library powering real third-party agents, not just first-party services:

| Integration | Framework | Contribution | Status |
|---|---|---|---|
| [**hermes-otel-plugin**](https://github.com/Mandark-droid/hermes-otel-plugin) | [NousResearch Hermes](https://github.com/NousResearch/hermes-agent) | A standalone `otel` plugin (`hermes plugins install Mandark-droid/hermes-otel-plugin`) exporting Hermes turns / LLM calls / tool calls as OTel GenAI spans **and** dashboard log records, with no changes to Hermes core. When `genai-otel-instrument` is installed it additionally unlocks on-prem **GPU / energy / CO2 metrics**, **local-model cost** (parameter-size pricing for Ollama / HF / vLLM), and an inline **eval / guardrail suite** (PII, toxicity, bias, prompt-injection, restricted-topics, hallucination) scored on prompt **and** response — signals no vanilla OTel SDK or other GenAI instrumentor emits. Originally upstream [PR #48184](https://github.com/NousResearch/hermes-agent/pull/48184) — approved on code review, then republished standalone per Hermes's policy that observability backends ship as standalone plugin repos. | **Shipped** (standalone plugin, MIT) |

## Featured In

- [**Context Engineering - AI ecosystem**](https://bonigarcia.dev/context-engineering/ai-ecosystem.html) - TraceVerde is listed under *Assurance & governance > Observability* in the AI ecosystem catalog that accompanies Boni García's book [*Context Engineering: Build Consistent, Accurate, Predictable AI Systems*](https://www.manning.com/books/context-engineering) (Manning).

## Who Uses TraceVerde?

TraceVerde is used by developers and teams building production GenAI applications. If you're using TraceVerde, we'd love to hear from you!

[Add your company](https://github.com/Mandark-droid/genai_otel_instrument/issues/new?title=Add+my+company+to+users+list&labels=users) | [Join Discord](https://discord.gg/6SVz6VKK)

<!-- Add your company/project logo and link here -->

## Community

- [Documentation](https://mandark-droid.github.io/genai_otel_instrument/) - Full guides, API reference, and tutorials
- [Discord](https://discord.gg/6SVz6VKK) - Chat with the community
- [GitHub Issues](https://github.com/Mandark-droid/genai_otel_instrument/issues) - Bug reports and feature requests
- [Contributing](https://mandark-droid.github.io/genai_otel_instrument/community/contributing/) - How to contribute
- [Human and LLM agent contributions](https://mandark-droid.github.io/genai_otel_instrument/community/agent-contributions/) - How agents can report gaps or submit focused fixes

## License

Copyright 2025 Kshitij Thakkar. Licensed under the [Apache License 2.0](LICENSE).
