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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.8.tar.gz
Algorithm Hash digest
SHA256 2272ec26afdd09e9aa136b121614d75458fb626838eff8ad3d2ad2168a9d6d1a
MD5 a503758300263395e58d681c3ceb1b98
BLAKE2b-256 0939d1771c6d32cfb557b6230789dfcc8807d1dd8c9e83e41ef54e9ffbc70cfb

See more details on using hashes here.

Provenance

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

Publisher: release.yml on traceloop/openllmetry

Attestations:

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.8-py3-none-any.whl
Algorithm Hash digest
SHA256 6531a2e2ff84c817f7111a9d6fa57cab9294504f1e5000dc3342d21551e4e047
MD5 1d2e937ef6e2ab76c4867a1753aff3cf
BLAKE2b-256 bacc5ca09a087db8b4b39d6097e11992b1a505c0eda516ceed8f8a3d3e5af132

See more details on using hashes here.

Provenance

The following attestation bundles were made for opentelemetry_instrumentation_openai-0.33.8-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