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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.9.tar.gz
Algorithm Hash digest
SHA256 5989a6049e63a09a6e9d699c077f7bbc932c0bda5a08f9ec0f4e88fd0c38d8b7
MD5 9d7ed0834c86aeb40a080d9ac1e1310f
BLAKE2b-256 758c9c30f9ac0ac6f9f8af655e6d8e4375f5c91f6a91cd3bbaaa52bed2b4bbda

See more details on using hashes here.

Provenance

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

Publisher: release.yml on traceloop/openllmetry

Attestations:

File details

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

File metadata

File hashes

Hashes for opentelemetry_instrumentation_openai-0.33.9-py3-none-any.whl
Algorithm Hash digest
SHA256 9a54ec31a66c212cd42b7f02701beecea4068effdf227b11c96fecfbc6544f40
MD5 9a64626c6970f89eeee771dd454aabae
BLAKE2b-256 1e5b6037e904a30360b2efa965c4d3bee5d3ff4257a6bf518388476e26c7eb6c

See more details on using hashes here.

Provenance

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