Monitoring and Observability
MoFA provides comprehensive monitoring capabilities through a web-based dashboard, metrics collection, WebSocket updates, and distributed tracing integration.Dashboard Server
Quick Start
http://127.0.0.1:8080
Configuration
Metrics Collection
Agent Metrics
Track agent state and performance:Workflow Metrics
Monitor workflow execution:LLM Metrics
Track LLM API usage and performance:Plugin Metrics
Monitor plugin health:System Metrics
Track system resources:REST API
The dashboard exposes REST endpoints:Endpoints
Example Response
WebSocket Updates
Real-time updates via WebSocket:Client Connection
Server-side Alerts
Dashboard Integration
Integrate monitoring into your application:Distributed Tracing
OpenTelemetry Integration
Span Instrumentation
Context Propagation
Metrics Export
Prometheus Format
JSON Export
Authentication
Token-based Auth
Custom Auth Provider
Best Practices
- Sample high-frequency events: Use sampling for high-throughput metrics
- Aggregate metrics: Compute averages and percentiles before export
- Set retention policies: Automatically clean old metrics data
- Monitor the monitor: Track dashboard performance and health
- Secure access: Use authentication in production environments
- Rate limit updates: Avoid overwhelming WebSocket clients
- Use structured logging: Enable correlation with tracing
- Alert on anomalies: Set up automated alerting for critical metrics
Performance Considerations
- Metrics buffering: Metrics are buffered before updates
- Async collection: Non-blocking metrics collection
- Connection pooling: WebSocket connections are pooled
- Lazy evaluation: Expensive metrics computed on-demand
Troubleshooting
High Memory Usage
Slow Dashboard
WebSocket Disconnects
Implement reconnection logic:See Also
- Workflow Orchestration - Monitor workflow execution
- Persistence - Store metrics data
- Security - Secure monitoring endpoints