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.4.tar.gz (7.0 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.4-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_openai_agents-0.1.4.tar.gz
  • Upload date:
  • Size: 7.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.0 CPython/3.13.0 Darwin/24.1.0

File hashes

Hashes for traceai_openai_agents-0.1.4.tar.gz
Algorithm Hash digest
SHA256 60f0817d96f1dc23efadf48381ccf88e210475ef7c2089163d74dc6b19c9b7b0
MD5 bcb0b91dbbe5fb6ecd76ea4eecadd582
BLAKE2b-256 7701c3c4a28de2157c0793d467d4fc5fe38f64866c034f68af5b12b5dbc22694

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for traceai_openai_agents-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c579a15f8806262399495331fa930d61d3f7e0cacffbc304474166fc3d9fc95a
MD5 2baa43f3b69e3afaced67ada47bc75ef
BLAKE2b-256 dab2209485ce61d7096fa3a57b1d14db4b8a6213381c9e2d6c0a3c4ccf74be64

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