Skip to content

feat(utils): add health check utilities for cloud providers#131

Open
shivv23 wants to merge 1 commit intoc2siorg:mainfrom
shivv23:feat/health-checks
Open

feat(utils): add health check utilities for cloud providers#131
shivv23 wants to merge 1 commit intoc2siorg:mainfrom
shivv23:feat/health-checks

Conversation

@shivv23
Copy link
Copy Markdown

@shivv23 shivv23 commented Apr 6, 2026

Summary

Add health check utilities for monitoring provider availability.

Why

Production apps need to check if cloud providers are reachable.

What

  • HealthChecker - aggregate multiple checks
  • HealthStatus - structured response with latency
  • check_tcp_port() - TCP connectivity check
  • check_http_endpoint() - HTTP health check

Usage

let checker = HealthChecker::new()
    .add_check("AWS", || async {
        check_http_endpoint("https://aws.amazon.com", Duration::from_secs(5)).await
    });

let healthy = checker.is_healthy().await;

Files

  • rustcloud/src/utils/health/mod.rs

Copy link
Copy Markdown
Contributor

@Sandipmandal25 Sandipmandal25 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file added in this PR is not declared as a module anywhere in the crate so it is never compiled it is dead code and has no effect on the library. Please run cargo build locally and confirm it compiles before marking this ready for review.

Comment on lines +1 to +15
use std::collections::HashMap;
use std::time::{Duration, Instant};

use crate::errors::CloudError;

#[derive(Debug, Clone)]
pub struct HealthStatus {
pub healthy: bool,
pub latency_ms: Option<u64>,
pub message: Option<String>,
}

#[derive(Debug, Clone)]
pub struct HealthCheckConfig {
pub timeout: Duration,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The file added in this PR is not declared as a module anywhere in the crate so it is never compiled it is dead code and has no effect on the library. There are also no CI checks running on this branch so compilation errors would not be caught automatically but you should verify this before opening one more new pr reporting this again . Beyond the wiring issue there is at least one code level bug in this PR that would prevent compilation. Please run cargo build locally and confirm it compiles before marking this ready for review.

@shivv23 shivv23 force-pushed the feat/health-checks branch from bea3fad to 72d12c5 Compare April 7, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants