Skip to content

improve instrumentation docs #1625

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open

improve instrumentation docs #1625

wants to merge 9 commits into from

Conversation

samuelcolvin
Copy link
Member

No description provided.

Copy link
Contributor

hyperlint-ai bot commented May 1, 2025

PR Change Summary

Improved the instrumentation documentation for Logfire, enhancing clarity and usability.

  • Added detailed instructions for using Logfire with PydanticAI.
  • Updated examples to demonstrate instrumentation setup and usage.
  • Clarified monitoring capabilities for HTTP requests using Logfire.

Modified Files

  • docs/logfire.md
  • docs/troubleshooting.md

How can I customize these reviews?

Check out the Hyperlint AI Reviewer docs for more information on how to customize the review.

If you just want to ignore it on this PR, you can add the hyperlint-ignore label to the PR. Future changes won't trigger a Hyperlint review.

Note specifically for link checks, we only check the first 30 links in a file and we cache the results for several hours (for instance, if you just added a page, you might experience this). Our recommendation is to add hyperlint-ignore to the PR to ignore the link check for this PR.

Copy link

github-actions bot commented May 1, 2025

Docs Preview

commit: ad4e358
Preview URL: https://14b4e940-pydantic-ai-previews.pydantic.workers.dev

@Kludex Kludex requested a review from alexmojaki May 1, 2025 13:37
@Kludex Kludex mentioned this pull request May 1, 2025
3 tasks

* **Debugging** — Using the live view to see what's happening in your application in real-time.
* **Monitoring** — Using SQL and dashboards to observe the behavior of your application, Logfire is effectively a SQL database that stores information about how your application is running.

### Debugging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The video here really needs updating


agent = Agent('openai:gpt-4o', instrument=True)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like you've removed all mentions of Agent(instrument=...) which seems extreme

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's still in the API docs.

from pydantic_ai.agent import Agent
from pydantic_ai.models.instrumented import InstrumentationSettings

os.environ['OTEL_EXPORTER_OTLP_ENDPOINT'] = 'http://localhost:4318'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand it might still be worth showing this this way, but I just want to point out that:

  1. OTLPSpanExporter uses that value by default anyway
  2. OTLPSpanExporter(endpoint=...) can be used instead of an env var

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