Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use raw OTel and actual event loggers in InstrumentedModel #945

Merged
merged 12 commits into from
Feb 21, 2025

Conversation

alexmojaki
Copy link
Contributor

@alexmojaki alexmojaki commented Feb 19, 2025

#875.

@github-actions github-actions bot temporarily deployed to deploy-preview February 19, 2025 16:00 Inactive
Copy link

github-actions bot commented Feb 20, 2025

Docs Preview

commit: 345d3e2
Preview URL: https://acbd9fb1-pydantic-ai-previews.pydantic.workers.dev

@alexmojaki alexmojaki marked this pull request as ready for review February 20, 2025 15:59
@alexmojaki alexmojaki requested review from samuelcolvin, Kludex and dmontagu and removed request for samuelcolvin and dmontagu February 20, 2025 16:00
@Kludex
Copy link
Member

Kludex commented Feb 20, 2025

Why we are doing this?

@alexmojaki
Copy link
Contributor Author

Because the semantic conventions require log events, not zero duration spans.

@alexmojaki alexmojaki changed the title Use raw OTel in InstrumentedModel Use raw OTel and actual event loggers in InstrumentedModel Feb 21, 2025
@alexmojaki
Copy link
Contributor Author

I've renamed the PR. I'm trying to follow the semantic conventions and also getting to know OTel logs/events. That switch also leaves no reason to tie InstrumentedModel to the logfire SDK since OTel logs can contain complex bodies unlike spans. And in general we want pydantic-ai to be usable without logfire.

@alexmojaki alexmojaki merged commit 4a472bd into main Feb 21, 2025
15 checks passed
@alexmojaki alexmojaki deleted the alex/raw-otel branch February 21, 2025 10:57
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.

2 participants