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.5.tar.gz (8.5 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.5-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: traceai_openai_agents-0.1.5.tar.gz
  • Upload date:
  • Size: 8.5 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.5.tar.gz
Algorithm Hash digest
SHA256 577487ca441ad10e64c4f6b5c2ca80b52eeeb23fa71559f1f85260898af8d6c0
MD5 ea015c173f0e87d25cf1041bd09ad73a
BLAKE2b-256 a77b303e51148f3b0e0e5255b37cf5e4ec57c5c198ecbf730a87f2ed11f8a7a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for traceai_openai_agents-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 ef0f845c3f7b2b1b496a1b90f7a6ba3c939c9e5997ab6f9c07241bbbfc0361e1
MD5 0d7f99c3d9aa13dcd68e43e9a0dbcd7b
BLAKE2b-256 add86c7c19fd8ea6aa735fa1687661a0bd49c8a444ebe508706e9989d0c08716

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