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

Built Distribution

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.3.tar.gz
Algorithm Hash digest
SHA256 06ad92d5d852f93ee7c0d9b545a412df5265044dae4d6be7056a10fa8afb2fdc
MD5 8cd2772dc984c6b0ae36733e45e592e9
BLAKE2b-256 3f4e984b46a69f3726b6f6f328941a116966d53c5f0b22bb44f9d60b70fedfb9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f5ef4452b269bb409cc260fd611834c33296495e39700fd6e6f83a1cef07b9fd
MD5 0ca32ff593c8fc64720c35625a067535
BLAKE2b-256 9374753c10c2f69bd4c81b7c8b944962be4e0c5880e6d07e547def4e5bfd1f4f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page