Principle:Langgenius Dify Observability
| Knowledge Sources | Dify |
|---|---|
| Domains | Frontend, Observability, Logging |
| Last Updated | 2026-02-12 07:00 GMT |
Overview
Observability defines the structured log and trace models used for monitoring application behavior including chat conversations, workflow executions, and agent interactions.
Description
The Observability principle establishes the data models and patterns for capturing, structuring, and presenting application telemetry within the Dify frontend. The log models define typed representations of execution events across the platform's primary interaction modes: chat conversations, workflow runs, and autonomous agent executions. Each log type captures domain-specific metadata alongside common fields such as timestamps, durations, token usage, and completion status.
These structured log models serve dual purposes. First, they provide the data layer for the application's built-in observability dashboards, where operators can inspect individual executions, identify performance bottlenecks, and diagnose failures. Second, they establish a contract for the log data exchanged between the backend API and frontend visualization components, ensuring that both sides agree on the shape and semantics of telemetry data.
The principle emphasizes comprehensive coverage without excessive verbosity. Log models capture the information needed to reconstruct the execution flow of any interaction, including intermediate steps in workflow execution and tool calls made by agents. This level of detail supports both real-time monitoring and post-hoc debugging while keeping the data volume manageable through structured rather than free-form logging.
Usage
Use this principle when:
- Defining or extending log data models for new types of application interactions
- Building observability dashboard components that visualize execution traces
- Implementing log filtering, search, and aggregation features in the frontend
Theoretical Basis
Observability draws from distributed systems observability theory, particularly the three pillars of metrics, logs, and traces. The structured log model approach follows the principles of structured logging advocated by the observability community, where log entries are machine-parseable records rather than free-form text. The execution trace model aligns with the OpenTelemetry span concept, capturing causally related events within a single interaction.