feat(observability): token/成本归集只存在于 Langfuse 链路——引擎与 console 零字段,未开 Langfuse 的部署成本完全不可见
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 38/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- python
- Domain
- backend, frontend, observability
Research direction
Start by reading obs.py:496-518 and :549-551, then trace ExecutionState in storage/base.py and the worker terminal path in flow_worker.py:1920-1928. Review local_executor.py:297-322 and console models/flow.py:185-212 to understand current Langfuse and execution storage. Done means usage is retained without Langfuse and the console shows per-node and run-level totals while Langfuse remains a deep link.
Written by the indexing model from the issue text.
Description
场景 gap 单(okguitar 提报)· 优先级 P1 · 依赖:无
基线 HEAD = ddcedae。
Summary
- usage 唯一去处在
obs.py:496-518(llm 形状输出 → Langfuse generation usage_details)与 :549-551(agent 子事件),由 Langfuse 服务端聚合——plaita 自己的存储不落任何 usage:ExecutionState(storage/base.py)无 usage/cost 字段(grep 证实)、$NODE无、console LocalExecution 表(models/flow.py:185-212)无;console 后端 grep usage|token|cost 除 obs_link 外零命中。 - 开关默认关:local 档
_build_langfuse_callback默认auto(无 LANGFUSE_PUBLIC_KEY 即不观测,local_executor.py:297-322);worker 侧需显式PLAITA_WORKER_LANGFUSE=1(flow_worker.py:1920-1928)。
影响
未启用 Langfuse 的部署里,每天几十 run 的 token 消耗在系统任何地方都不可见;启用了也没有 run 级成本报表/阈值告警——数小时 AGENTRUN 失控循环只能事后去 Langfuse 手工聚合。
建议
worker 终态时把各节点 usage 聚合写进 ExecutionState(如 usage_json),console 执行详情页展示 per-node/run 两级汇总;Langfuse 退为深链(obs_link 已具备);在此基础上才能谈 per-tenant 配额(见配额配套单)。
- Dominant language
- Python
- Stars
- 0
- Forks
- 1
- Avg merge
- 1h 44m
- Merged PRs (30d)
- 7
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jeffkit/plaita
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 4/5 3-5 days Newbie friendliness 70/100
-
keeper-ignore
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Similar issues
-
changelog investigate
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ramnes/notion-sdk-py#409 ·
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
lindicaphxag-tech/kaggle#28 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
BSData/horus-heresy-3rd-edition#3211 ·
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug tests
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day