Skip to main content

OpenTelemetry OpenAI Instrumentation

This library allows tracing OpenAI prompts and completions sent with the official OpenAI library.

Installation

pip install opentelemetry-instrumentation-openai

Example usage

from opentelemetry.instrumentation.openai import OpenAIInstrumentor

OpenAIInstrumentor().instrument()

Privacy

By default, this instrumentation logs prompts, completions, and embeddings to span attributes. This gives you a clear visibility into how your LLM application is working, and can make it easy to debug and evaluate the quality of the outputs.

However, you may want to disable this logging for privacy reasons, as they may contain highly sensitive data from your users. You may also simply want to reduce the size of your traces.

To disable logging, set the TRACELOOP_TRACE_CONTENT environment variable to false.

TRACELOOP_TRACE_CONTENT=false

Metadata

Release files for opentelemetry-instrumentation-openai-tk-karini 0.45.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opentelemetry-instrumentation-openai-tk-karini 0.45.3
File Size Uploaded
opentelemetry_instrumentation_openai_tk_karini-0.45.3.tar.gz 24.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opentelemetry-instrumentation-openai-tk-karini 0.45.3
File Interpreter ABI Platform
opentelemetry_instrumentation_openai_tk_karini-0.45.3-py3-none-any.whl Python 3 none any Details

Total release size: 59.2 kB

Release files / opentelemetry_instrumentation_openai_tk_karini-0.45.3.tar.gz

Download URL opentelemetry_instrumentation_openai_tk_karini-0.45.3.tar.gz
Size 24.7 kB
Tags Source
SHA-256 checksum
How to use checksums
301daa181b6ef991d42a885fd2a8ce89271a737e761d8e450564bff7244d049f
BLAKE2b-256 checksum
How to use checksums
67feb3bcdb31fe96e2093a24d4d86862d10bca903e196ca95aa4329a65824e24
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / opentelemetry_instrumentation_openai_tk_karini-0.45.3-py3-none-any.whl

Download URL opentelemetry_instrumentation_openai_tk_karini-0.45.3-py3-none-any.whl
Size 34.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
32a499d9e680b142729e9c7f2b92b2c51b988abc886634fb60404a17961f1875
BLAKE2b-256 checksum
How to use checksums
70b8b9b1161be248f7e7f0983d089f29ad02b27538317d15f538403b23fea058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.45.3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page