[Refactor/Chore] Standardize workflow telemetry to OpenTelemetry gen_ai conventions
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 24.6k
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 610
Description
### Self Checks
- [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542).
- [x] This is only for refactors or chores; if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general).
- [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, otherwise it will be closed.
- [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
- [x] Please do not modify this template :) and fill in all the required fields.
### Description
The workflows in Dify currently have some OpenTelemetry-related instrumentation points, but these instrumentation points do not strictly follow the semantic conventions defined in https://opentelemetry.io/docs/specs/semconv/registry/attributes/gen-ai/. I would like to normalize/standardize the generated observability data through https://github.com/alibaba/loongsuite-python-agent/tree/main/util/opentelemetry-util-genai. After the transformation, for example, the recorded input.value attribute would be normalized into the standard OTel spec attribute gen_ai.input.messages.
### Motivation
Adhering to standard OpenTelemetry semantic conventions is critical for building robust and interoperable observability systems. By following the standardized attribute naming and data model defined by the OpenTelemetry specification, observability data becomes consistent and machine-readable across different systems, frameworks, and vendors. This standardization enables seamless integration with a wide range of observability backends and analysis tools — such as Prometheus, Jaeger, Grafana, and others — without requiring custom parsing or transformation logic. Furthermore, standardized telemetry data significantly improves the developer experience by providing a unified and predictable schema, making it easier to correlate traces, metrics, and logs across distributed systems. In the context of Generative AI applications, conforming to the gen_ai semantic conventions ensures that model inputs, outputs, token usage, and other critical signals are captured in a way that is universally understood, enabling better monitoring, debugging, and optimization of AI-powered workflows.
### Additional Context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.