Skip to content

add weave and langfuse observability support#638

Open
yiyunliu wants to merge 3 commits intomasterfrom
obs2
Open

add weave and langfuse observability support#638
yiyunliu wants to merge 3 commits intomasterfrom
obs2

Conversation

@yiyunliu
Copy link
Copy Markdown
Contributor

This PR adds observability support (#605) through Langfuse and Weave. The implementation simply instruments template, tool, and other llm related operations to use the decorator provided by the respective framework. Langfuse requires a bit more effort because its native litellm support doesn't seem compatible with custom spans for effectful handlers. I had to write some code to populate cost and token information from the litellm response.

This PR is different from #632, which aims to provide more flexibility by hand-rolling some observability functionalities so they can be accessed by the programmer directly.

@kiranandcode
Copy link
Copy Markdown
Contributor

Possibly relevant: #391

maybe things have changed since then.

@yiyunliu
Copy link
Copy Markdown
Contributor Author

#391 was closed in favor of #493, which suggests that effectful should use litellm's logging backend. I did try litellm's langfuse_otel backend through the callback interface. The issue is that you only see the LLM API calls but you don't see any of the template or tool traces unless you instrument those functions yourself. The same happens with weave I think.

@yiyunliu yiyunliu requested a review from eb8680 April 14, 2026 13:16
@yiyunliu
Copy link
Copy Markdown
Contributor Author

To provide more context, here's a screenshot of langfuse with litellm's native callback support after calling limerick:
llmlitenative

and a screenshot of langfuse with call traces produced by the PR:
instrumented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants