Skip to content

Conversation

@giuliastf
Copy link
Collaborator

@giuliastf giuliastf commented Oct 6, 2025

Description
This pull request adds enhanced status handling to the LangChainExporter in 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

  • Add this package as a dependency in your pyproject.toml:
[project]
dependencies = [
  # Exact version:
  "uipath-langchain==0.0.137.dev1002030643",

  # Any version from PR
  "uipath-langchain>=0.0.137.dev1002030000,<0.0.137.dev1002040000"
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-langchain = { index = "testpypi" }

@giuliastf giuliastf self-assigned this Oct 6, 2025
@giuliastf giuliastf force-pushed the feat/status_interrupt branch from a15e9b4 to f385d59 Compare October 6, 2025 13:56
@giuliastf giuliastf marked this pull request as ready for review October 6, 2025 14:05
@giuliastf giuliastf requested review from Copilot and ionmincu and removed request for Copilot October 6, 2025 14:05
Copy link

Copilot AI left a 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}")
Copy link

Copilot AI Oct 6, 2025

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).

Suggested change
logger.debug(f"Status determined: {self.Status.INTERRUPTED}")
logger.debug("Status determined: %s", self.Status.INTERRUPTED)

Copilot uses AI. Check for mistakes.
Comment on lines 223 to 225
logger.debug(f"Span error info: {error}")
status = self._determine_status(error)
logger.debug(f"Determined status: {status}")
Copy link

Copilot AI Oct 6, 2025

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).

Copilot uses AI. Check for mistakes.
@giuliastf giuliastf force-pushed the feat/status_interrupt branch 2 times, most recently from 1c6ac16 to 847541f Compare October 6, 2025 14:09
@giuliastf giuliastf force-pushed the feat/status_interrupt branch from 847541f to e69f7e1 Compare October 6, 2025 14:17
@giuliastf giuliastf merged commit c813a66 into main Oct 6, 2025
32 checks passed
@giuliastf giuliastf deleted the feat/status_interrupt branch October 6, 2025 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants