Skip to main content

OpenAI OpenTelemetry Integration

Overview

This integration provides support for using OpenTelemetry with the OpenAI framework. It enables tracing and monitoring of applications built with OpenAI.

Installation

  1. Install traceAI OpenAI
pip install traceAI-openai

Set Environment Variables

Set up your environment variables to authenticate with FutureAGI

import os

os.environ["FI_API_KEY"] = FI_API_KEY
os.environ["FI_SECRET_KEY"] = FI_SECRET_KEY
os.environ["OPENAI_API_KEY"] = OPENAI_API_KEY

Quickstart

Register Tracer Provider

Set up the trace provider to establish the observability pipeline. The trace provider:

from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType

trace_provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="openai_app"
)

Configure OpenAI Instrumentation

Set up your OpenAI client with built-in observability. This includes support for text, image, and audio models.

from traceai_openai import OpenAIInstrumentor

OpenAIInstrumentor().instrument(tracer_provider=trace_provider)

Create OpenAI Components

Set up your OpenAI client with built-in observability.

import openai

openai.api_key = os.environ["OPENAI_API_KEY"]

response = openai.ChatCompletion.create(
    model="gpt-4-0",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Can you tell me a joke?"}
    ]
)

print(response.choices[0].message['content'].strip())

Metadata

Release files for traceAI-openai 0.1.11

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traceAI-openai 0.1.11
File Size Uploaded Provenance Actions
traceai_openai-0.1.11.tar.gz 22.0 kB With provenance Details for traceai_openai-0.1.11.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceAI-openai 0.1.11
File Interpreter ABI Platform Actions
traceai_openai-0.1.11-py3-none-any.whl Python 3 none any Details for traceai_openai-0.1.11-py3-none-any.whl

Total release size: 50.3 kB

Release files / traceai_openai-0.1.11.tar.gz

Download URL traceai_openai-0.1.11.tar.gz
Size 22.0 kB
Tags Source
SHA-256 checksum
How to use checksums
02f44cbb525f000b4dfe95ac43d661b89739c7535dfb25ee0ca73dbdb0093678
BLAKE2b-256 checksum
How to use checksums
64a4779e6caae676a6db30ec112e8d5377e5189a5fc4d3d0c033ac181029625b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / traceai_openai-0.1.11-py3-none-any.whl

Download URL traceai_openai-0.1.11-py3-none-any.whl
Size 28.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5ad3a9429e078847e093309858074a05c5d8835bde7435e6272deb360150c25e
BLAKE2b-256 checksum
How to use checksums
b4fb6eee32a6b8d1312c9a3d9ef6d9931112d44ad3324cd4e224fef3292b3b39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for traceAI-openai 0.1.11

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for traceai_openai-0.1.11.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page