feat: add custom events and metrics broadcasting via Stream Video#325
feat: add custom events and metrics broadcasting via Stream Video#325
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughThis PR introduces metrics broadcasting functionality enabling agents to periodically emit performance metrics to call participants via custom events. Implementation spans a new abstract interface in EdgeTransport, concrete support in StreamEdge, background task lifecycle management in Agent, and comprehensive test coverage. Changes
Sequence DiagramsequenceDiagram
actor Agent as Agent Instance
participant EdgeTransport
participant StreamEdge
actor CallAPI as GetStream Call API
actor Participants as Call Participants
Agent->>Agent: _metrics_broadcast_loop starts<br/>(background task)
loop Every broadcast_metrics_interval seconds
Agent->>Agent: send_metrics_event()
Agent->>Agent: gather current metrics
Agent->>EdgeTransport: send_custom_event(metrics_data)
EdgeTransport->>StreamEdge: send_custom_event(metrics_data)
activate StreamEdge
StreamEdge->>StreamEdge: validate call connected
StreamEdge->>CallAPI: call.send_call_event(custom=data)
deactivate StreamEdge
CallAPI->>Participants: broadcast custom event
end
Agent->>EdgeTransport: on close: cancel broadcast task
Estimated Code Review Effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
d70410f to
44f78e1
Compare
44f78e1 to
8726a6a
Compare
Add ability to send custom events and metrics to call participants through Stream Video's custom events API. This enables building real-time dashboards in client apps. - Add send_custom_event() to EdgeTransport and StreamEdge - Add send_custom_event() and send_metrics_event() to Agent - Add broadcast_metrics and broadcast_metrics_interval constructor params for automatic periodic metrics broadcasting - Store Call reference in StreamEdge for event sending
8726a6a to
42ef602
Compare
Add ability to send custom events and metrics to call participants through Stream Video's custom events API. This enables building real-time dashboards in client apps.
Summary by CodeRabbit
Release Notes
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.