Skip to content

chore: Add Agent.instrument_all() call for tracing#325

Merged
viveknair merged 1 commit intonextfrom
vivek/fix-pydantic-example
Jun 25, 2025
Merged

chore: Add Agent.instrument_all() call for tracing#325
viveknair merged 1 commit intonextfrom
vivek/fix-pydantic-example

Conversation

@viveknair
Copy link
Copy Markdown
Contributor

@viveknair viveknair commented Jun 25, 2025

PR Description

TLDR

Adds Agent.instrument_all() to enable tracing in Pydantic AI example

Summary

This PR adds instrumentation to the Pydantic AI simple example to enable proper tracing of agent operations through OpenTelemetry.

Key Changes

  • Added Agent.instrument_all() call before Gentrace initialization in the example script
  • Ensures Pydantic AI's OpenTelemetry traces are properly captured

Impact

  • Affects only the examples/pydantic_ai_simple.py file
  • No changes to core functionality or other examples

Testing Considerations

  • Verify that Pydantic AI traces are now properly captured in Gentrace
  • Ensure the example runs without errors with the new instrumentation
  • Check that trace data includes agent-specific operations

@viveknair viveknair marked this pull request as ready for review June 25, 2025 23:38
@viveknair viveknair merged commit 91c3473 into next Jun 25, 2025
7 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
* chore: Add Agent.instrument_all() call for tracing (#325)

* release: 1.0.0-alpha.8

---------

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