π@hsuite/health - Comprehensive System Health Monitoring
π₯ Advanced health monitoring and system diagnostics library for NestJS applications with DAG network monitoring
Enterprise-grade health monitoring solution providing real-time system resource tracking, service health checks, performance metrics collection, and specialized DAG network monitoring with event-driven updates and comprehensive diagnostics.
π Table of Contents
β¨ Quick Start
Installation
npm install @hsuite/healthBasic Setup
Health Check Usage
ποΈ Architecture
Core Component Areas
π₯ System Health Monitoring
Real-time Health Checks - Comprehensive system health validation
Service Connectivity - MongoDB, Redis, and microservice monitoring
Health Status Aggregation - Multi-service health state management
Cached Responses - Efficient health check performance optimization
π Resource Metrics Collection
CPU Monitoring - Real-time CPU utilization and multi-core tracking
Memory Management - Memory usage, availability, and percentage tracking
Disk Space Monitoring - Storage utilization and free space alerts
Network Metrics - Input/output traffic monitoring and analysis
π DAG Network Monitoring
Network Health Tracking - Specialized DAG network status monitoring
Event-Driven Updates - Real-time threshold monitoring with events
Network Threshold Management - Online/offline status detection
Performance Optimization - Efficient network status collection
β‘ Performance Features
Response Caching - 1-second caching for optimal performance
Error Handling - Comprehensive exception management
Resource Optimization - Efficient OS utility integration
Multi-core Support - Advanced CPU usage calculations
Module Structure
π§ API Reference
Core Health Endpoints
All health endpoints are publicly accessible with @Public() decorator.
Health Check Endpoint
GET /health/check
Purpose: Comprehensive system health validation
Caching: 1-second response caching
Monitors: Redis, MongoDB, disk space, memory, DAG network, microservices
System Information Endpoint
GET /health/infos
Purpose: Detailed system metrics and resource utilization
Caching: 1-second response caching
Data: Platform, CPU, memory, disk, network metrics
Health Check Response Schema
System Information Schema
Resource Metrics Tables
usage
number
CPU utilization percentage (0-100)
cpus
number
Number of CPU cores
speed
number
CPU clock frequency in MHz
totalMemMb
number
Total memory in MB
usedMemMb
number
Used memory in MB
freeMemMb
number
Free memory in MB
usedMemPercentage
number
Memory usage percentage
freeMemPercentage
number
Free memory percentage
totalGb
string
Total storage in GB
usedGb
string
Used storage in GB
freeGb
string
Free storage in GB
usedPercentage
string
Storage usage percentage
freePercentage
string
Free storage percentage
π Guides
Health Monitoring Setup Guide
Complete guide to setting up comprehensive health monitoring for your application. Comprehensive setup instructions covering health indicator configuration, system monitoring, resource tracking, service health checks, and enterprise-grade health monitoring with real-time alerts and notifications.
DAG Network Monitoring Guide
Learn how to implement and monitor DAG network health with event-driven updates. Advanced monitoring guide covering DAG network connectivity, consensus monitoring, network performance tracking, event-driven health updates, and enterprise-grade network monitoring with automated diagnostics.
Performance Optimization Guide
Best practices for optimizing health monitoring performance and resource usage. Detailed optimization guide covering monitoring efficiency, resource utilization optimization, performance tuning, scalability improvements, and enterprise-grade performance optimization for health monitoring systems.
Alert and Threshold Management Guide
Set up proactive monitoring with alerts and threshold-based notifications. Comprehensive guide for implementing alert systems, threshold configuration, notification management, escalation procedures, and enterprise-grade monitoring with automated alerting and incident response.
π― Examples
Comprehensive Health Monitoring Service
DAG Network Monitoring Service
Advanced Redis Configuration Service
Health Metrics Analytics Service
π Integration
Required Dependencies
Module Integration
Documentation Generation
Environment Configuration
Integration with HSuite Ecosystem
Performance Considerations
π Caching Strategy
1-Second Caching - Health checks and metrics responses cached for optimal performance
Memory Management - Efficient resource metrics collection with OS utilities
Event-Driven Updates - DAG network status uses events to reduce polling overhead
π§ Optimization Features
Multi-core CPU Calculations - Advanced CPU usage calculations for multi-core systems
Efficient Collection - Optimized OS utility integration for resource monitoring
Connection Pooling - Redis connection optimization for health checks
π‘οΈ Error Handling
Comprehensive Exception Management - Proper error types and detailed messages
Graceful Degradation - Fallback mechanisms for failed health checks
Service Isolation - Individual service failures don't affect overall monitoring
π₯ Enterprise Health Monitoring: Comprehensive system diagnostics with real-time resource tracking and specialized DAG network monitoring.
π Advanced Analytics: Performance analysis, trend calculation, and intelligent recommendations for system optimization.
π DAG Network Integration: Event-driven network monitoring with threshold management and automated status updates.
Built with β€οΈ by the HSuite Team Copyright Β© 2025 HSuite. All rights reserved.
Last updated