- Introduced Aggregator.sol for Chainlink-compatible oracle functionality, including round-based updates and access control. - Added OracleWithCCIP.sol to extend Aggregator with CCIP cross-chain messaging capabilities. - Created .gitmodules to include OpenZeppelin contracts as a submodule. - Developed a comprehensive deployment guide in NEXT_STEPS_COMPLETE_GUIDE.md for Phase 2 and smart contract deployment. - Implemented Vite configuration for the orchestration portal, supporting both Vue and React frameworks. - Added server-side logic for the Multi-Cloud Orchestration Portal, including API endpoints for environment management and monitoring. - Created scripts for resource import and usage validation across non-US regions. - Added tests for CCIP error handling and integration to ensure robust functionality. - Included various new files and directories for the orchestration portal and deployment scripts.
6.0 KiB
6.0 KiB
🔍 Service Monitoring - Besu, Cacti, Firefly, Chainlink CCIP
Overview
Comprehensive monitoring system for blockchain and interoperability services integrated into the orchestration portal.
Monitored Services
1. Besu (Hyperledger Besu)
- Block number and chain status
- Peer count and network connectivity
- Sync status (syncing/synced/behind)
- Gas price and network metrics
- Pending transactions
- Resource usage (CPU, memory, disk)
- Chain ID and network ID
2. Cacti (Hyperledger Cacti)
- Connector count
- Active connections
- Transaction metrics (total, pending, failed)
- Average latency
- Resource usage (CPU, memory)
3. Firefly (Hyperledger Firefly)
- Namespace count
- Active APIs
- Transaction metrics (total, pending, failed)
- Average latency
- Resource usage (CPU, memory)
- Database connections
4. Chainlink CCIP (Cross-Chain Interoperability Protocol)
- Router address and configuration
- Active chains count
- Message metrics (total, pending, failed)
- Average latency
- Token transfers
- Fee token balance
- Resource usage (CPU, memory)
Features
✅ Implemented
-
Monitoring API Endpoints
/api/monitoring/dashboard- Overall health summary/api/monitoring/besu- Besu metrics/api/monitoring/cacti- Cacti metrics/api/monitoring/firefly- Firefly metrics/api/monitoring/chainlink-ccip- Chainlink CCIP metrics/api/monitoring/services/:type/:name/status- Service status/api/monitoring/environments/:name/collect- Collect all metrics
-
Database Schema
service_monitoringtable for metrics storage- Indexed for fast queries
- Supports historical data
-
Monitoring Service
MonitoringServiceclass for metrics collection- Simulated metrics (ready for Prometheus integration)
- Health status calculation
- Automatic metric storage
-
Vue Dashboard
MonitoringDashboard.vue- Main monitoring view- Service-specific components:
BesuMonitoring.vueCactiMonitoring.vueFireflyMonitoring.vueChainlinkCCIPMonitoring.vue
ServiceHealthCard.vue- Health overview cardsMetricCard.vue- Individual metric display
-
Real-time Updates
- WebSocket integration
- Auto-refresh every 30 seconds
- Live updates on metric collection
API Usage
Get Monitoring Dashboard
GET /api/monitoring/dashboard
Response:
{
"besu": {
"total": 5,
"healthy": 4,
"degraded": 1,
"unhealthy": 0,
"services": [...]
},
"cacti": {...},
"firefly": {...},
"chainlinkCcip": {...}
}
Get Besu Metrics
GET /api/monitoring/besu?environment=workload-azure-eastus&service=besu-validator-1
Collect All Metrics
POST /api/monitoring/environments/workload-azure-eastus/collect
Database Schema
service_monitoring
CREATE TABLE service_monitoring (
id INTEGER PRIMARY KEY AUTOINCREMENT,
service_name TEXT NOT NULL,
service_type TEXT NOT NULL,
environment TEXT,
metric_name TEXT NOT NULL,
metric_value REAL NOT NULL,
metric_unit TEXT,
status TEXT NOT NULL,
timestamp TEXT NOT NULL,
metadata TEXT
);
Integration with Prometheus
The monitoring service is designed to integrate with Prometheus. Replace the simulated metrics with actual Prometheus queries:
// Example: Replace collectBesuMetrics with Prometheus query
async collectBesuMetrics(environment: string, serviceName: string): Promise<BesuMetrics> {
// Query Prometheus
const blockNumber = await prometheus.query(
`besu_blockchain_blockNumber{instance="${serviceName}"}`
);
const peerCount = await prometheus.query(
`besu_network_peers{instance="${serviceName}"}`
);
// ... etc
}
Metrics Collected
Besu
block_number- Current block numberpeer_count- Number of connected peerscpu_usage- CPU utilization percentagememory_usage- Memory utilization percentagedisk_usage- Disk utilization percentage
Cacti
connector_count- Number of connectorsactive_connections- Active connection countfailed_transactions- Failed transaction countaverage_latency- Average transaction latency
Firefly
namespace_count- Number of namespacesactive_apis- Active API countfailed_transactions- Failed transaction countdatabase_connections- Database connection count
Chainlink CCIP
active_chains- Number of active chainstotal_messages- Total message countfailed_messages- Failed message countaverage_latency- Average message latency
Health Status Calculation
Healthy
- All critical metrics within normal ranges
- No failed operations above threshold
- Resource usage below warning levels
Degraded
- Some metrics outside optimal range
- Increased failed operations
- Resource usage approaching limits
Unhealthy
- Critical metrics in danger zone
- High failure rates
- Resource usage at critical levels
Access
URL: http://localhost:5000/monitoring or /monitoring in the Vue app
Future Enhancements
- Prometheus integration (replace simulated metrics)
- Grafana dashboards export
- Alert rules and thresholds
- Historical trend analysis
- Custom metric queries
- Service-specific dashboards
- Export metrics to CSV/JSON
- Metric comparison across environments
- Performance benchmarking
Configuration
Environment Variables
# Prometheus endpoint (when integrated)
PROMETHEUS_URL=http://prometheus:9090
# Metrics collection interval
METRICS_COLLECTION_INTERVAL=30000 # 30 seconds
Testing
Test monitoring endpoints:
# Get dashboard
curl http://localhost:5000/api/monitoring/dashboard
# Get Besu metrics
curl http://localhost:5000/api/monitoring/besu?environment=workload-azure-eastus
# Collect metrics
curl -X POST http://localhost:5000/api/monitoring/environments/workload-azure-eastus/collect
Status: ✅ Monitoring system implemented and ready!
Last Updated: 2024-11-19 Version: 1.0.0