Samples for OpenAI AgentsOpenAI plugin OpenTelemetry support#275
Draft
jssmith wants to merge 3 commits intotemporalio:mainfrom
Draft
Samples for OpenAI AgentsOpenAI plugin OpenTelemetry support#275jssmith wants to merge 3 commits intotemporalio:mainfrom
jssmith wants to merge 3 commits intotemporalio:mainfrom
Conversation
This commit adds a comprehensive set of OTEL tracing examples demonstrating three progressive patterns: 1. Basic: Pure automatic instrumentation - plugin handles everything 2. Custom Spans: trace() + custom_span() for logical grouping 3. Direct API: trace() + custom_span() + direct OTEL tracer for detailed instrumentation Key additions: - openai_agents/otel_tracing/ directory with README and three workflow examples - Worker and client scripts for each pattern - Documentation covering setup, configuration, and troubleshooting - Added required OTEL dependencies to pyproject.toml Pattern clarification: - Never use trace() in client code - Use trace() in workflows when using custom_span() (patterns 2 & 3) - Plugin automatically creates root trace for pure automatic instrumentation Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Corrects the documentation and code to reflect the proper usage of trace(): - trace() should be used in workflows when using custom_span() (patterns 2 & 3) - Never use trace() in client code - Pattern 1 (basic): No trace() needed - plugin creates root trace automatically - Pattern 2 (custom spans): trace() + custom_span() in workflow - Pattern 3 (direct API): trace() + custom_span() + OTEL tracer in workflow Updates: - README with clearer pattern explanations and examples - Direct API workflow to use trace() + custom_span() pattern - All docstrings to document the correct patterns - Troubleshooting section with pattern-specific guidance Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Rename client scripts to use _workflow.py suffix for consistency with other samples. Simplify code by removing verbose docstrings, comments, and output messages to match the minimal style used throughout the repository. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add samples for using OTel with OpenAI Agents SDK (temporalio/sdk-python#1286)