Skip to content

feat: improve input/output detection for traces in the langwatch integration #7067

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

0xdeafcafe
Copy link

@0xdeafcafe 0xdeafcafe commented Mar 13, 2025

Hey, I'm an engineer at @langwatch. This PR improves the input/output detection for traces when the langwatch integration is enabled.

Related issue: #6909

Screenshot 2025-03-13 at 16 26 38 Screenshot 2025-03-13 at 16 26 26

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. enhancement New feature or request labels Mar 13, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 13, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 13, 2025
Copy link

codspeed-hq bot commented Mar 13, 2025

CodSpeed Performance Report

Merging #7067 will improve performances by 15.66%

Comparing 0xdeafcafe:improve/langwatch-tracing-input-output-detection (f045712) with main (4d9138f)

Summary

⚡ 2 improvements
✅ 17 untouched benchmarks

Benchmarks breakdown

Benchmark BASE HEAD Change
test_build_flow_invalid_job_id 9.3 ms 8.3 ms +11.61%
test_cancel_build_success 248.7 ms 215 ms +15.66%

@0xdeafcafe 0xdeafcafe force-pushed the improve/langwatch-tracing-input-output-detection branch from 8f969f2 to cf01678 Compare March 13, 2025 15:51
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 13, 2025
@0xdeafcafe 0xdeafcafe force-pushed the improve/langwatch-tracing-input-output-detection branch from 25f6704 to e990c11 Compare March 16, 2025 19:22
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 16, 2025
Copy link
Contributor

@Copilot 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 langwatch integration by refining how input/output data for traces is detected and updated. The changes add conditional updates for the root trace span based on the sender of the inputs.

  • Update root span input when the sender is "User"
  • Update root span output when the sender is "Machine"

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Mar 17, 2025
Copy link
Member

@italojohnny italojohnny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, @0xdeafcafe ! How’s it going?

I tried running your PR locally and got the following exception:

ValueError: No current trace found, could not get_current_trace(), make sure you added a @langwatch.trace() decorator
on your LLM pipeline top-level function

The current code on the main branch doesn’t throw this exception, so I’m guessing something’s off. Could you clarify what might be happening?
Screenshot 2025-03-17 at 11 13 26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants