Availability
| Edition | Deployment Type |
|---|---|
| Community & Enterprise | Self-Managed, Hybrid |
Overview
In the hub-and-spoke architecture:- AI Studio is the control plane (hub)
- Edge Gateway instances are edge nodes (spokes)
- Cache statistics aggregation
- Shared state synchronization
- Audit log centralization
- Custom analytics collection
- Alert and notification routing
Architecture
Data Flow
- Edge Plugin calls
SendToControl()orSendToControlJSON() - Payload is queued to SQLite database (survives gateway restarts)
- During heartbeat (every 30s), pending payloads are batched
- Batch is sent via gRPC
SendPluginControlBatchRPC - Control Server routes each payload to the target plugin
- Studio plugin’s
AcceptEdgePayload()is called with the data
Edge Plugin: Sending Data
SDK Functions
The Edge Gateway SDK provides two functions for sending data to the control plane:SendToControl
Send raw byte payloads:Expandable
SendToControlJSON
Convenience function for JSON payloads:Expandable
Function Signatures
Expandable
Payload Limits
| Limit | Value |
|---|---|
| Maximum payload size | 1 MB |
| Maximum metadata entries | 50 |
| Maximum metadata key length | 256 bytes |
| Maximum metadata value length | 4096 bytes |
| Maximum correlation ID length | 256 bytes |
Queue Behavior
- Persistence: Payloads are stored in SQLite and survive gateway restarts
- Batching: Payloads are batched during heartbeat (default: every 30s)
- Batch size: Up to 100 payloads per batch
- Retention: Successfully sent payloads are deleted; failed payloads are retried
- Cleanup: Payloads older than 24 hours are automatically cleaned up
Example: Complete Edge Plugin
Expandable
Control Plane Plugin: Receiving Data
EdgePayloadReceiver Interface
AI Studio plugins implementEdgePayloadReceiver to receive payloads from edge instances:
EdgePayload Structure
Example: Complete Control Plane Plugin
Expandable
Plugin ID Matching
The control plane routes payloads based on plugin ID. When an edge plugin sends a payload, it’s associated with that plugin’s numeric ID. The control plane then delivers it to the AI Studio plugin with the same ID.Configuration
- Create AI Studio plugin (control plane receiver)
- Note the plugin ID (e.g.,
42) - Deploy Edge Gateway plugin with the same ID configuration
- Edge payloads from plugin 42 will be routed to AI Studio plugin 42
Example Setup
Expandable
Error Handling
Edge Plugin Errors
Expandable
Control Plane Plugin Errors
Expandable
Best Practices
Edge Plugins
- Batch locally first: Aggregate data before sending to reduce payload count
- Use correlation IDs: For request/response matching or debugging
- Include metadata: Add context like metric type, source, timestamp
- Handle errors gracefully: Queue failures shouldn’t crash your plugin
- Monitor pending count: High pending counts may indicate connectivity issues
Control Plane Plugins
- Check metadata first: Return
handled=falsequickly for irrelevant payloads - Validate payloads: Don’t trust edge data - validate before processing
- Use KV for persistence: Store aggregated data for dashboard/API access
- Log with context: Include edge ID and correlation ID in logs
- Handle duplicates: Network issues may cause duplicate deliveries
Performance
- Keep payloads small: Smaller payloads = faster transmission
- Aggregate at edges: Send summaries, not individual events
- Use appropriate intervals: Balance freshness vs. overhead
- Monitor queue depth: Alert on growing queues
Troubleshooting
Payloads Not Arriving
Payloads Not Arriving
- Check edge connectivity: Verify edge can reach control plane
- Check plugin IDs: Edge and control plugins must have matching IDs
- Check logs: Look for errors in both edge and control logs
- Verify plugin loaded: Ensure control plane plugin is active
High Latency
High Latency
- Check batch interval: Default is 30s heartbeat
- Check payload size: Large payloads take longer to transmit
- Check network: Latency between edge and control
- Check queue depth: High pending count = backlog
Payloads Being Dropped
Payloads Being Dropped
- Check payload size: Must be under 1MB
- Check queue capacity: Queue may be full
- Check retention: Payloads older than 24h are cleaned up
- Check errors: Processing errors may cause drops