Rule Orchestration
Rule Orchestration
Rule Orchestration in eKuiper Manager allows you to define, deploy, and monitor stream processing logic. It transforms raw data streams from sources (like MQTT or HTTP) into actionable insights or filtered outputs sent to sinks (like databases or cloud services).
Rule Management Lifecycle
The manager provides a full lifecycle interface for eKuiper rules, supporting standard CRUD operations and state control.
1. Creating a Rule
A rule consists of three primary components:
- ID: A unique identifier for the rule.
- SQL: The processing logic using eKuiper SQL syntax.
- Actions (Sinks): An array of destinations where the processed data is sent.
Example Rule Configuration:
{
"id": "rule_thermal_monitor",
"sql": "SELECT temp, humidity FROM sensor_stream WHERE temp > 50",
"actions": [
{
"log": {}
},
{
"mqtt": {
"server": "tcp://broker.local:1883",
"topic": "alerts/high_temp"
}
}
]
}
Note: A valid Stream must be created before a rule can reference it in the
FROMclause.
2. Lifecycle Controls
Rules can be managed directly from the Rule List view:
- Start/Stop: Toggle the execution state of the rule.
- Edit: Modify the SQL or actions (requires a rule restart).
- Delete: Permanently remove the rule from the eKuiper instance.
Advanced Debugging & Visualization
eKuiper Manager offers specialized tools to peek into how rules are executing in real-time.
Rule Tracing
Capture live data packets as they flow through the rule. This is essential for debugging complex transformations.
- Start Tracing: Begins recording "spans" (individual data processing events).
- Trace Details: View exact message attributes and values at different stages of the pipeline.
Rule Topology
The Topology View generates a visual graph of your data flow. It maps the rule's path from Sources through Operators (Filters, Joins, Aggregations) to Sinks.
- AI Analysis: Use the integrated AI Assistant to generate plain-English descriptions for each node in the topology graph, making complex SQL logic accessible to non-technical operators.
Query Plan (Explain)
For performance-critical applications, the Explain feature visualizes the execution plan. It identifies:
- Logical steps (Scan, Filter, Project).
- Potential performance bottlenecks.
- Data flow efficiency.
AI-Assisted Orchestration
The manager integrates an AI Assistant (powered by OpenRouter) to simplify rule creation and maintenance.
Rule Generation
Technicians can describe processing requirements in natural language. The AI interprets the available stream schemas and connection metadata to generate:
- Valid eKuiper SQL.
- Sink configurations.
- Recommended rule options (QoS, Event Time, etc.).
Operational Analysis
The AI can analyze a rule's Current Status & Metrics. It provides insights into:
- Input/Output Rates: Identifying if data is flowing as expected.
- Exception Handling: Explaining why messages are being dropped or why the rule has encountered errors.
- Optimization Hints: Suggesting SQL improvements to reduce CPU or memory usage.
Rule Metrics & Monitoring
Each rule tracks real-time operational metrics:
- Messages In/Out: Count of processed events.
- Exceptions: Count of errors encountered during execution.
- Last Trigger Time: The timestamp of the last processed message.
These metrics are accessible via the Rule Dashboard, providing an immediate overview of the health of your edge processing pipelines.