Skip to content

feat: Add OpenAI Agents instrumentation example#322

Merged
viveknair merged 3 commits intonextfrom
vivek/openai-agents
Jun 25, 2025
Merged

feat: Add OpenAI Agents instrumentation example#322
viveknair merged 3 commits intonextfrom
vivek/openai-agents

Conversation

@viveknair
Copy link
Copy Markdown
Contributor

@viveknair viveknair commented Jun 25, 2025

PR Description

TLDR

Adds OpenAI Agents (Swarm) instrumentation example with automatic tracing via OpenInference

Summary

This PR introduces a new example demonstrating how to instrument OpenAI Agents SDK with Gentrace for automatic tracing of agent conversations, tool calls, and agent handoffs. The example showcases integration with OpenInference instrumentation for full observability.

Key Changes

  • Added openai_agents_instrumentation.py example file with travel assistant agent demo
  • Updated README.md to include the new OpenAI Agents example in the LLM integrations section
  • Added installation instructions for openai-agents and openinference-instrumentation-openai-agents packages
  • Implemented sample tools (weather checking and flight booking) to demonstrate agent functionality

Impact

  • Examples directory: New example file and updated documentation
  • Dependencies: Requires additional packages for OpenAI Agents support
  • No core library changes: Only affects example code

Testing Considerations

  • Verify the example runs correctly with proper API keys configured
  • Test that OpenInference instrumentation properly captures agent interactions and tool calls
  • Ensure the travel assistant agent demonstrates expected behavior with weather and flight booking tools

@graphite-app
Copy link
Copy Markdown
Contributor

graphite-app bot commented Jun 25, 2025

How to use the Graphite Merge Queue

Add the label merge-queue to this PR to add it to the merge queue.

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

@socket-security
Copy link
Copy Markdown

socket-security bot commented Jun 25, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedopenai-agents@​0.0.1972100100100100
Addedopeninference-instrumentation-openai-agents@​0.1.1499100100100100

View full report

@viveknair viveknair changed the base branch from main to next June 25, 2025 20:29
@viveknair viveknair marked this pull request as ready for review June 25, 2025 20:30
@viveknair viveknair merged commit 96f3f23 into next Jun 25, 2025
10 checks passed
@stainless-app stainless-app bot mentioned this pull request Jun 25, 2025
viveknair pushed a commit that referenced this pull request Jun 25, 2025
* feat: Add OpenAI Agents instrumentation example (#322)

* feat: Add OpenAI Agents instrumentation example

* feat: Add automatic tracing for OpenAI Agents SDK

* fix: Update default pipeline id value in interaction definition

* release: 1.0.0-alpha.7

---------

Co-authored-by: Vivek Nair <vivek@gentrace.ai>
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
viveknair pushed a commit that referenced this pull request Jun 30, 2025
* feat: Add OpenAI Agents instrumentation example (#322)

* feat: Add OpenAI Agents instrumentation example

* feat: Add automatic tracing for OpenAI Agents SDK

* fix: Update default pipeline id value in interaction definition

* chore: Add otel_setup configuration in init() and check diff
stainless-app bot pushed a commit that referenced this pull request Jul 4, 2025
* feat: Add OpenAI Agents instrumentation example (#322)

* feat: Add OpenAI Agents instrumentation example

* feat: Add automatic tracing for OpenAI Agents SDK

* fix: Update default pipeline id value in interaction definition

* chore: Add otel_setup configuration in init() and check diff
viveknair pushed a commit that referenced this pull request Jul 6, 2025
* chore: Add otel_setup configuration in init() and check diff (#324)

* feat: Add OpenAI Agents instrumentation example (#322)

* feat: Add OpenAI Agents instrumentation example

* feat: Add automatic tracing for OpenAI Agents SDK

* fix: Update default pipeline id value in interaction definition

* chore: Add otel_setup configuration in init() and check diff

* release: 1.0.0-alpha.9

---------

Co-authored-by: Vivek Nair <vivek@gentrace.ai>
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant