Skip to content

feat(langchain): Add automatic instrumentation#183

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-feat-add-langchain-auto-instrument
Apr 1, 2026
Merged

feat(langchain): Add automatic instrumentation#183
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-feat-add-langchain-auto-instrument

Conversation

@AbhiPrasad
Copy link
Copy Markdown
Member

Building on top of #150, this PR adds automatic instrumentation for langchain. Now when you call braintrust.auto_instrument() you'll get langchain automatically instrumented.

Add a CallbackPatcher base primitive and use it to model LangChain as an SDK integration that installs a default Braintrust callback handler. Export the LangChain integration, wire it into auto_instrument(), and add focused setup and auto-instrument tests.

Also document CallbackPatcher usage in the sdk-integrations skill so future integrations can use the same pattern for setup-only side effects.

@starfolkai
Copy link
Copy Markdown
Contributor

starfolkai Bot commented Mar 31, 2026

Drop into this review session: sfk devbox connect pr-183-braintrust-sdk-python-2518 --attach

No serious bugs or issues found 🎉

Add a CallbackPatcher base primitive and use it to model LangChain as an SDK integration that installs a default Braintrust callback handler. Export the LangChain integration, wire it into auto_instrument(), and add focused setup and auto-instrument tests.

Also document CallbackPatcher usage in the sdk-integrations skill so future integrations can use the same pattern for setup-only side effects.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) merged commit 2c68b88 into main Apr 1, 2026
28 checks passed
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) deleted the abhi-feat-add-langchain-auto-instrument branch April 1, 2026 16:00
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