Skip to main content

OpenTelemetry instrumentation for OpenAI Agents

Project description

OpenAI Agents OpenTelemetry Integration

Overview

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

Installation

  1. Install traceAI OpenAI Agents
pip install traceAI-openai-agents

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

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_agents_app"
)

Configure OpenAI Agents Instrumentation

Instrument the OpenAI Agents client to enable telemetry collection. This step ensures that all interactions with the OpenAI Agents SDK are tracked and monitored.

from traceai_openai_agents import OpenAIAgentsInstrumentor

OpenAIAgentsInstrumentor().instrument(tracer_provider=trace_provider)

Create OpenAI Agents Components

Set up your OpenAI Agents client with built-in observability.

from agents import Agent, Runner

agent = Agent(name="Assistant", instructions="You are a helpful assistant")
result = Runner.run_sync(agent, "Write a haiku about recursion in programming.")

print(result.final_output)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

traceai_openai_agents-0.1.6.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

traceai_openai_agents-0.1.6-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file traceai_openai_agents-0.1.6.tar.gz.

File metadata

  • Download URL: traceai_openai_agents-0.1.6.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for traceai_openai_agents-0.1.6.tar.gz
Algorithm Hash digest
SHA256 da43179bb2334c57355b5846a69e10873f7bb0f4787495fd34a46d4c9b0c2adc
MD5 9ff17c40b1c7ab4e20ca7b2dd913ab43
BLAKE2b-256 df04a06587800da3a5d4233e5a660c27d07e0e579bf9c90ec5e9b25c863a15a1

See more details on using hashes here.

File details

Details for the file traceai_openai_agents-0.1.6-py3-none-any.whl.

File metadata

  • Download URL: traceai_openai_agents-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 9.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.21 {"installer":{"name":"uv","version":"0.9.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for traceai_openai_agents-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 b2edfd701f8908807a70dc1590fa1663ea4cbacc13e7b69334fd1e63505aa164
MD5 74a9f8f5889376a5bda4c9250340e752
BLAKE2b-256 a597464dcf5ab0fa92f3faec268b9a833f93aa5fa92f839623f141fc25912a51

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page