Skip to content

Conversation

@Hansehart
Copy link
Contributor

@Hansehart Hansehart commented Nov 13, 2025

Related Issues

Proposed Changes:

Replaced the try/finally pattern with a try/except/else pattern that properly captures and propagates exception information.
The Langfuse tracer was always calling exit(None, None, None) in a finally block, regardless of whether an exception occurred during pipeline execution. This told Langfuse/OpenTelemetry that all operations completed successfully, even when exceptions were raised.

How did you test it?

unit tests, manual verification

Notes for the reviewer

  • Errors are now automatically displayed in Langfuse. Before it looked like success. Warnings and Debug messages can be set manually.
  • Some formatting happend from hatch run fmt

Checklist

@github-actions github-actions bot added integration:langfuse type:documentation Improvements or additions to documentation labels Nov 13, 2025
@Hansehart
Copy link
Contributor Author

Screenshot

@Hansehart Hansehart marked this pull request as ready for review November 13, 2025 21:32
@Hansehart Hansehart requested a review from a team as a code owner November 13, 2025 21:32
@Hansehart Hansehart requested review from sjrl and removed request for a team November 13, 2025 21:32
@vblagoje vblagoje self-requested a review November 13, 2025 21:48
@vblagoje
Copy link
Member

thanks @Hansehart - I'll take a look @sjrl

Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

Looks mostly good but it seems we have some minor DRY violations where we can have one finally block (for try/else) with flush and token reset. wdyt?

@Hansehart
Copy link
Contributor Author

@vblagoje You're absolutely right! I have to admit its hard to read. But now its a bit better.

Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

LG

@vblagoje vblagoje merged commit 65549c4 into deepset-ai:main Nov 21, 2025
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration:langfuse type:documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Langfuse Integration: add support for log levels

2 participants