Skip to content

Conversation

constantinius
Copy link
Contributor

@constantinius constantinius commented Oct 10, 2025

  • Introduced onboarding steps for Pydantic AI, including configuration and verification instructions.
  • Updated the onboarding dropdown to include Pydantic AI as an option.
  • Added relevant links for Pydantic AI integration in the Python span origins.

Requires getsentry/sentry-python#4906 to be merged

Contributes to https://linear.app/getsentry/issue/TET-1242/python-sdk-pydantic-ai-integration

- Introduced onboarding steps for Pydantic AI, including configuration and verification instructions.
- Updated the onboarding dropdown to include Pydantic AI as an option.
- Added relevant links for Pydantic AI integration in the Python span origins.
Copy link

linear bot commented Oct 10, 2025

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 10, 2025
@constantinius constantinius marked this pull request as ready for review October 10, 2025 10:02
@constantinius constantinius requested review from a team as code owners October 10, 2025 10:02
Comment on lines +752 to +762
environment="local",
traces_sample_rate=1.0,
# Add data like inputs and responses to/from LLMs and tools;
# see https://docs.sentry.io/platforms/python/data-management/data-collected/ for more info
send_default_pii=True,
integrations=[
PydanticAiIntegration(),
],
# Disable OpenAI integration for correct token accounting
disabled_integrations=[OpenAIIntegration()],
)`,
Copy link
Contributor

Choose a reason for hiding this comment

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

Potential bug: The Pydantic AI getting started code snippet uses OpenAIIntegration without importing it, which will cause a NameError when the code is executed.
  • Description: The Python code snippet for the pydanticAiStep in the getting started documentation uses OpenAIIntegration within the disabled_integrations list. However, it omits the necessary import statement for OpenAIIntegration. When a user copies and executes this code, their application will raise a NameError during the sentry_sdk.init() call, preventing the application from starting. This pattern is inconsistent with other similar code snippets in the same file which correctly include the import.

  • Suggested fix: Add from sentry_sdk.integrations.openai import OpenAIIntegration to the Python code snippet within the pydanticAiStep component. This will resolve the NameError by making the class available before it's referenced in disabled_integrations.
    severity: 0.85, confidence: 1.0

Did we get this right? 👍 / 👎 to inform future reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant