发布

  • Implementing Tracing Functionality in Flow Execution (#1895)

    frostbyte_neo 发布于 2024-02-01 12:30:33 +00:00

    Description

    This PR introduces tracing functionality in the flow execution process.
    The primary change involves wrapping the original _exec function with
    a new function, _exec_with_trace, which starts a new span, enriches it
    with input and output data, and sets the span status. This enhancement
    allows us to organize child spans into a flow-level trace, providing a
    more comprehensive view of flow execution.

    Key changes include:

    • New Function - _exec_with_trace: This function is similar to
      _exec, but includes additional tracing functionality. It starts a new
      span, enriches it with input and output data, and sets the span status.
    • Exception Handling: Exceptions are handled within the context of the
      new function. In the event of an exception, the span status is set to
      StatusCode.ERROR, and the exception is raised.
    • Span Enrichment: The new function enriches the span with input and
      output data, providing a more detailed view of the flow execution
      process.
    • Status Setting: The span status is set based on the execution of the
      function. If the function executes successfully, the status is set to
      StatusCode.OK. If an exception occurs, the status is set to
      StatusCode.ERROR.

    This enhancement will improve our ability to track and monitor the flow
    execution process, aiding in debugging and performance optimization
    efforts.

    All Promptflow Contribution checklist:

    • The pull request does not introduce [breaking changes].
    • CHANGELOG is updated for new features, bug fixes or other
      significant changes.
    • I have read the contribution guidelines.
    • Create an issue and link to the pull request to get dedicated
      review from promptflow team. Learn more: suggested
      workflow
      .

    General Guidelines and Best Practices

    • Title of the pull request is clear and informative.
    • There are a small number of commits, each of which have an
      informative message. This means that previously merged commits do not
      appear in the history of the PR. For more information on cleaning up the
      commits in your PR, see this
      page
      .

    Testing Guidelines

    • Pull request includes test coverage for the included changes.
    下载附件