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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.10.tar.gz
Algorithm Hash digest
SHA256 336ed472acaaac1cf8711c7e351f1df46665ed19fa1b48a7248375da7a7edd78
MD5 ca0eb446dfa0eaa38c0475de6e15519d
BLAKE2b-256 7eefc37ca4aac8c832b5e00fe823d6e2b0d4b757207952296c0a55465683eb7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_openai-0.33.10.tar.gz:

Publisher: release.yml on traceloop/openllmetry

Attestations:

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.10-py3-none-any.whl
Algorithm Hash digest
SHA256 bff1b0ca2801b6ec03ff5f5389cb730435ca15786cf2b5267ab5ece718299c71
MD5 ff52e4d4b02e9c44b6e63f0fabcb0ced
BLAKE2b-256 13139a0f8cfccae366f5775520eead1369af0fc8e0cc5c64ee23bb0e5beeffe8

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_openai-0.33.10-py3-none-any.whl:

Publisher: release.yml on traceloop/openllmetry

Attestations:

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