Skip to content

feat(callbacks_langfuse): expose trace id and observation id#906

Open
kayoch1n wants to merge 3 commits into
cloudwego:mainfrom
kayoch1n:feat/expose-langfuse-span-id
Open

feat(callbacks_langfuse): expose trace id and observation id#906
kayoch1n wants to merge 3 commits into
cloudwego:mainfrom
kayoch1n:feat/expose-langfuse-span-id

Conversation

@kayoch1n

@kayoch1n kayoch1n commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

feat

Check the PR title.

  • This PR title match the format: <type>(optional scope): <description>
  • The description of this PR title is user-oriented and clear enough for others to understand.
  • Attach the PR updating the user documentation if the current PR requires user awareness at the usage level. User docs repo

(Optional) Translate the PR title into Chinese.

提供暴露 langfuse trace id 和 observation id的 API

(Optional) More detailed description for this PR(en: English/zh: Chinese).

en:

I am working on agents created by different languages and frameworks. Currently, both trace id and observation id are internally managed by eino-ext. When incooperated with agents NOT managed by eino, or even not written in golang, such as opencode and claude code, there is no way to attach their traces to eino agent's. Exposing the trace id and observation id makes this binding possible, producing a more comprehensive trace graph on langfuse

zh(optional):

目前 trace id 和 observation id 都是由 eino-ext 内部创建并管理的。当我想把其他非eino框架实现的agent,比如claude code或者opencode,编排到eino的工作流里的时候,我发现实际上是无法将它们的trace和eino的trace关联起来。

通过暴露 langfuse trace id 和 observation id,就可以将这些agent的trace挂到eino的observation之下,实现在同一条trace中展示所有agent的trace

(Optional) Which issue(s) this PR fixes:

(optional) The PR that updates user documentation:

@kayoch1n
kayoch1n force-pushed the feat/expose-langfuse-span-id branch 3 times, most recently from 98249b5 to 1fa4ef7 Compare July 11, 2026 13:36
@kayoch1n

kayoch1n commented Jul 15, 2026

Copy link
Copy Markdown
Contributor Author

@mrh997 @shentongmartin hi, 是否有时间帮忙review一下?

我们的业务场景是这样的:我们有一些用opencode写的agent,我想在eino中编排这些agent,同时也能在langfuse上追踪。目前欠缺两个事情:

  1. 在context里暴露 trace id 和 observation id,也就是本 PR
  2. 遵循otel 规定,产生16位hex的span id,对应这个 feat(libs_langfuse): create span id in 16-hex chars #907

实现这个之后,就可以在同一条trace里追踪eino和opencode了

@kayoch1n
kayoch1n force-pushed the feat/expose-langfuse-span-id branch 2 times, most recently from a6f3473 to 99c0e25 Compare July 20, 2026 03:31
@kayoch1n
kayoch1n force-pushed the feat/expose-langfuse-span-id branch from 99c0e25 to 3016a70 Compare July 22, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant