Skip to main content

OpenTelemetry OpenAI instrumentation

Project description

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

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opentelemetry_instrumentation_openai-0.16.6.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file opentelemetry_instrumentation_openai-0.16.6.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.16.6.tar.gz
Algorithm Hash digest
SHA256 69b148e38d15f21ad93b1afcf80142de36c69b31995b91ddb0caea525da88849
MD5 67d9ef968a732a16fc0a7f7adba22367
BLAKE2b-256 3603fbc8355720988d840b69ae644e5ef69f8874ed2dd3d6102c9d7ed8086aa1

See more details on using hashes here.

File details

Details for the file opentelemetry_instrumentation_openai-0.16.6-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.16.6-py3-none-any.whl
Algorithm Hash digest
SHA256 0c672356a6a42effde899b55aa75d24c2005a0d85fa7be3a92cea374e0e5030b
MD5 2972e079d9afa4d90e1e66c41b63a261
BLAKE2b-256 17a40864439a4a8835ea9849857ef4e3beab7d8ab1de817cf8613c1bb575ffd1

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