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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.6.tar.gz
Algorithm Hash digest
SHA256 828fa2b381cc8f880ca9b5c31a260c9150b7774185d76a248498ef896caff2ec
MD5 bb4f22c329e763e6fbc70df735773f44
BLAKE2b-256 4b807a06bf32b5fd961e8ad206cb1e9b2c3af03b4bae589dcdbd5977d387d059

See more details on using hashes here.

Provenance

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

Publisher: release.yml on traceloop/openllmetry

Attestations:

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.6-py3-none-any.whl
Algorithm Hash digest
SHA256 178caae20bda7a63060a47ebe2ecb5253e32d8c00238f0bba7e3f96d683a47a7
MD5 6aebccb490d0df79ef92c1770615a964
BLAKE2b-256 d983bd67cc547b32d1a317553798ae85c538648bb09789143aad124eaec6e4c8

See more details on using hashes here.

Provenance

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