-
Notifications
You must be signed in to change notification settings - Fork 18.7k
fix(core): honor enabled=false
in nested tracing
#31986
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
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
CodSpeed WallTime Performance ReportMerging #31986 will not alter performanceComparing
|
CodSpeed Instrumentation Performance ReportMerging #31986 will not alter performanceComparing Summary
|
enabled=false
in nested tracing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes a bug where the enabled=false
parameter in nested tracing contexts was not being properly honored, allowing traces to be persisted when they should have been disabled.
Key changes:
- Updated the LangSmithTracer to check tracing context enablement state and mark runs as disabled
- Added early returns in persistence methods to skip disabled runs
- Enhanced test coverage to verify nested tracing behavior with disabled contexts
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
libs/core/langchain_core/tracers/langchain.py | Implements the core fix by checking tracing context state and skipping persistence for disabled runs |
libs/core/tests/unit_tests/runnables/test_tracing_interops.py | Adds test case to verify nested tracing with disabled context works correctly |
No description provided.