Skip to content

[HER Hack-Astron # 2] Langfuse integration via OpenTelemetry bridgeFeat/otel langfuse bridge - #1614

Closed
Karen0758 wants to merge 2 commits into
iflytek:mainfrom
Karen0758:feat/otel-langfuse-bridge
Closed

[HER Hack-Astron # 2] Langfuse integration via OpenTelemetry bridgeFeat/otel langfuse bridge#1614
Karen0758 wants to merge 2 commits into
iflytek:mainfrom
Karen0758:feat/otel-langfuse-bridge

Conversation

@Karen0758

@Karen0758 Karen0758 commented Aug 13, 2026

Copy link
Copy Markdown

AI Assistance Disclosure

This PR was developed with AI assistance.

  • Agent / model: Codex
  • Main prompt: add Langfuse-compatible tracing to Astron Agent through the existing OpenTelemetry/OTLP path, while keeping the default gRPC exporter behavior.
  • Human work: I reviewed the existing Astron tracing flow, configured and tested the local Docker environment, connected Astron to a Langfuse Cloud project, and verified the exported traces. The 新春游故宫20260811165759 demo workflow used for validation was provided by another team member. @Tomatoes0814

Closes #1575

Summary

This PR adds Langfuse-compatible tracing support through Astron's existing OpenTelemetry integration. It keeps OTLP/gRPC as the default behavior and adds OTLP/HTTP support for backends such as Langfuse Cloud, without introducing the Langfuse SDK into Astron's agent runtime.

Changes

  • Add OTLP/HTTP trace exporter support.
  • Support standard OpenTelemetry env vars:
    • OTEL_EXPORTER_OTLP_PROTOCOL
    • OTEL_EXPORTER_OTLP_ENDPOINT
    • OTEL_EXPORTER_OTLP_HEADERS
  • Pass OTLP config to workflow service.
  • Add workflow node metadata to exported spans, including node name, status, selected branch, model name, latency, and token usage.
  • Add config docs and exporter selection tests.

Verification

Verified with a real local Astron workflow: 新春游故宫20260811165759. Screenshots are attached below.

  • Langfuse Trace ID: a0e518210dae343d9696142d4dd8d705
  • Trace name: /workflow/v1/debug/chat/completions
  • Workflow latency: 6.78s
  • LLM node: run_node:spark-llm:大模型_2:deepseek-v4-flash
  • Model: deepseek-v4-flash
  • Token usage: 117 prompt -> 124 completion (Σ 241)
  • LLM latency: 2.15s
1 2 3 4

@CLAassistant

CLAassistant commented Aug 13, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Signed-off-by: yuanli <13564291248@163.com>
Signed-off-by: yuanli <13564291248@163.com>
@Karen0758
Karen0758 force-pushed the feat/otel-langfuse-bridge branch from 10c8584 to 0de21f7 Compare August 13, 2026 08:45
@FenjuFu
FenjuFu requested review from lyj715824 and removed request for lyj715824 August 17, 2026 05:28

@FenjuFu FenjuFu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for the real Langfuse trace evidence and the OTLP/HTTP integration work. Two blockers remain before approval:

  1. The current Check workflow job is failing because Black would reformat core/workflow/extensions/otlp/trace/trace.py. Please run the repository formatter and push the result so the CI summary is green.
  2. The added exporter-selection tests cover only core/common, while this PR also changes the separate core/workflow exporter and adds node-level observability attributes/span renaming. Please add focused tests for the workflow exporter protocol/endpoint/header selection and for the model/token/branch attributes plus span naming. The real trace proves the integration works, but these tests are needed to protect the two changed runtime paths from regression.

Please update the PR and request re-review after CI passes.

@FenjuFu

FenjuFu commented Aug 19, 2026

Copy link
Copy Markdown
Member

感谢你参与 HER Hack-Astron #2 并提交这份 Langfuse 可观测性集成 🙏

本期活动已完成评审。经社区 maintainers 综合评估,Langfuse 集成最终选定 #1607 作为合并实现,因此本 PR 不再单独合入,现予关闭 —— 这不代表你的方案质量不足,只是同一能力我们只保留一条实现路径,避免重复维护。

评选结果、获奖名单与领奖方式请见:
#1575 (comment)

你在 OpenTelemetry 桥接、Trace 语义和隐私边界上的思路对最终方案很有参考价值。欢迎继续关注后续的 HER Hack-Astron 活动,也欢迎在其他 issue 上继续贡献 🚀


Thank you for taking part in HER Hack-Astron #2 and submitting this Langfuse observability integration 🙏

Judging for this round is complete. After review by the community maintainers, #1607 was selected as the implementation to merge for Langfuse integration, so this PR is being closed rather than merged. This is not a reflection on the quality of your work — we're keeping a single implementation path for this capability to avoid duplicated maintenance.

Results, the award list, and how to claim your prize are here:
#1575 (comment)

Your work on the OpenTelemetry bridge, trace semantics and privacy boundaries fed usefully into the final design. We'd love to see you in the next HER Hack-Astron round, and contributions on other issues are always welcome 🚀

@FenjuFu FenjuFu closed this Aug 19, 2026
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.

HER Hack-Astron #2|[Feature Request] Support Langfuse integration for LLM observability, tracing and evaluation

3 participants