-
Notifications
You must be signed in to change notification settings - Fork 28
feat(status_interrupt): determine status based on err info #203
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
Conversation
a15e9b4 to
f385d59
Compare
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 enhances the LangChainExporter's status handling by introducing a status determination mechanism based on error information in spans. The changes allow for better tracking of operation outcomes by distinguishing between successful, error, and interrupted states.
- Adds a Status enum class with SUCCESS, ERROR, and INTERRUPTED constants
- Implements status determination logic that checks error messages for interruption patterns
- Integrates status determination into span processing to set the Status field
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if error: | ||
| logger.debug(f"Determining status from error: {error}") | ||
| if error and error.startswith("GraphInterrupt("): | ||
| logger.debug(f"Status determined: {self.Status.INTERRUPTED}") |
Copilot
AI
Oct 6, 2025
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.
Debug logging with f-strings can impact performance when logging is disabled. Consider using lazy evaluation: logger.debug('Determining status from error: %s', error) and logger.debug('Status determined: %s', self.Status.INTERRUPTED).
| logger.debug(f"Status determined: {self.Status.INTERRUPTED}") | |
| logger.debug("Status determined: %s", self.Status.INTERRUPTED) |
| logger.debug(f"Span error info: {error}") | ||
| status = self._determine_status(error) | ||
| logger.debug(f"Determined status: {status}") |
Copilot
AI
Oct 6, 2025
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.
Debug logging with f-strings can impact performance when logging is disabled. Consider using lazy evaluation: logger.debug('Span error info: %s', error) and logger.debug('Determined status: %s', status).
1c6ac16 to
847541f
Compare
847541f to
e69f7e1
Compare
Description
This pull request adds enhanced status handling to the
LangChainExporterin the OpenTelemetry adapter, allowing for more granular tracking of operation outcomes. The main changes introduce a status field that distinguishes between success, error, and interrupted operations based on error messages.Development Package