Topology Visualization
Rule Topology Visualization
The Rule Topology provides a graphical representation of your eKuiper stream processing logic. It transforms complex SQL queries into a Directed Acyclic Graph (DAG), allowing you to visualize exactly how data flows from its origin through various processing stages to its final destination.
Key Components
The topology graph consists of three primary node types:
- Sources: The entry points of your data (e.g., MQTT topics, HTTP endpoints, or EdgeX streams).
- Operators: Processing steps defined in your SQL logic. This includes:
- Filters/Where: Logic that determines which data packets continue through the pipeline (e.g.,
temp > 50). - Aggregations: Mathematical operations like averages, counts, or sums performed over time windows.
- Projections: Transformations that format or select specific fields from the data.
- Filters/Where: Logic that determines which data packets continue through the pipeline (e.g.,
- Sinks: The exit points where processed data is sent (e.g., a database, another MQTT topic, or a log).
AI-Powered Node Analysis
A unique feature of the eKuiper Manager is the AI Assistant Integration for topology nodes. Since raw node IDs and logic can sometimes be cryptic for factory technicians or non-developers, the manager uses an AI engine to provide plain-English explanations for every step in the graph.
How it works: The manager analyzes the SQL logic and the topology structure, then generates human-readable descriptions for each node.
Example Descriptions:
- Source Node: "Ingesting live temperature data from the warehouse MQTT broker."
- Filter Node: "Filters out any readings where the temperature is below 20°C."
- Aggregation Node: "Calculates the average humidity over a rolling 1-minute window."
- Sink Node: "Sends the finalized alert to the maintenance dashboard."
Accessing the Topology
To view the topology for a specific rule:
- Navigate to the Rules section in the sidebar.
- Select an active or stopped rule from the list.
- Click on the Topology tab.
- Use your mouse to pan and zoom around the graph. Clicking on specific nodes will reveal more detailed metrics and logic associated with that processing step.
Integration with Rule Tracing
The Topology view is closely integrated with the Rule Tracing feature. When tracing is enabled, you can see real-time data flow indicators across the edges of the graph. This allows you to visually identify where data might be getting dropped (e.g., at a filter node) or where processing latency is occurring.
API Context
For developers extending the manager, the topology is fetched via the eKuiper client. The data structure returned includes a set of sources and a map of edges:
// Conceptual structure of the topology data
interface RuleTopology {
sources: string[]; // Array of source node IDs
edges: { // Map of node connections
[key: string]: string[];
};
}
This structure is used by the frontend to render the visual graph and by the AI Analyze API (/api/ai/analyze) to map SQL logic to specific visual nodes.