feat: Support external trace_id propagation for end-to-end distributed tracing #15225

Closed
opened 2026-02-21 19:20:46 -05:00 by yindo · 0 comments
Owner

Originally created by @qiaofenlin on GitHub (Jul 9, 2025).

Originally assigned to: @qiaofenlin on GitHub.

Self Checks

  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

1. Is this request related to a challenge you're experiencing? Tell me about your story.

Currently, Dify generates a new trace_id internally for each request. However, in many enterprise scenarios, we already have upstream business systems that generate their own trace_id for distributed tracing. Since Dify does not support accepting and propagating external trace_id, it is impossible to achieve end-to-end tracing across the entire business chain. This makes it difficult to correlate logs and monitor requests that span multiple systems, which is frustrating for troubleshooting and performance analysis.

2. Additional context or comments

It would be very helpful if Dify could support receiving an external trace_id (e.g., via HTTP header or request parameter) and use it throughout the internal workflow, falling back to generating a new one only if none is provided. This would allow Dify to integrate seamlessly with existing distributed tracing systems (such as OpenTelemetry, Jaeger, Zipkin, etc.) and enable true full-link tracing.
Key points for discussion:

  • How to pass the trace_id (HTTP header, request parameter, etc.)
  • Validation and security considerations for the incoming trace_id
  • Backward compatibility (should not affect users who do not provide a trace_id)
  • Documentation and best practices for users

I am willing to participate in the design and implementation of this feature, and would love to discuss the details with the community!

3. Can you help us with this feature?

  • I am interested in contributing to this feature.
Originally created by @qiaofenlin on GitHub (Jul 9, 2025). Originally assigned to: @qiaofenlin on GitHub. ### Self Checks - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### 1. Is this request related to a challenge you're experiencing? Tell me about your story. Currently, Dify generates a new trace_id internally for each request. However, in many enterprise scenarios, we already have upstream business systems that generate their own trace_id for distributed tracing. Since Dify does not support accepting and propagating external trace_id, it is impossible to achieve end-to-end tracing across the entire business chain. This makes it difficult to correlate logs and monitor requests that span multiple systems, which is frustrating for troubleshooting and performance analysis. ### 2. Additional context or comments It would be very helpful if Dify could support receiving an external trace_id (e.g., via HTTP header or request parameter) and use it throughout the internal workflow, falling back to generating a new one only if none is provided. This would allow Dify to integrate seamlessly with existing distributed tracing systems (such as OpenTelemetry, Jaeger, Zipkin, etc.) and enable true full-link tracing. **Key points for discussion:** - How to pass the trace_id (HTTP header, request parameter, etc.) - Validation and security considerations for the incoming trace_id - Backward compatibility (should not affect users who do not provide a trace_id) - Documentation and best practices for users I am willing to participate in the design and implementation of this feature, and would love to discuss the details with the community! ### 3. Can you help us with this feature? - [x] I am interested in contributing to this feature.
yindo added the 💪 enhancement label 2026-02-21 19:20:46 -05:00
yindo closed this issue 2026-02-21 19:20:46 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15225