Skip to content

feat: Add health endpoint with status, timestamp, version, and uptime#23

Open
Nexussyn wants to merge 9 commits into
GautamKumarOffical:mainfrom
Nexussyn:feat/issue-16-health-endpoint-details
Open

feat: Add health endpoint with status, timestamp, version, and uptime#23
Nexussyn wants to merge 9 commits into
GautamKumarOffical:mainfrom
Nexussyn:feat/issue-16-health-endpoint-details

Conversation

@Nexussyn

@Nexussyn Nexussyn commented Jun 21, 2026

Copy link
Copy Markdown

Summary

Implements a health check endpoint at GET /health that returns detailed service health information including:

  • status: Service health status ("healthy")
  • timestamp: Current UTC timestamp in ISO 8601 format
  • version: Service version from Cargo.toml
  • uptime_seconds: Seconds since service started

Changes

  • Added backend/src/health.rs module with HealthResponse struct and handler
  • Updated backend/src/main.rs to include health endpoint route and track startup time
  • Updated backend/src/lib.rs to export health module
  • Added once_cell dependency for startup time tracking

Testing

cd backend
cargo build
cargo run &
curl http://localhost:3000/health
# Returns: {"status":"healthy","timestamp":"2024-...","version":"0.1.0","uptime_seconds":5}

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR
  • Documentation has been updated, if applicable
  • Configuration or schema changes are documented, if applicable
  • No generated build artifacts are committed, except the required diagnostic build log
  • Changes are scoped to the PR purpose and avoid unrelated cleanup
  • Security, privacy, and error-handling implications have been considered

Closes #16

@Nexussyn

Copy link
Copy Markdown
Author

Ready for merge — All issues resolved:

  • Restored all original Cargo.toml dependencies (tokio, tracing, uuid, clap, anyhow, reqwest, etc.) that were accidentally removed
  • Added axum and once_cell as new dependencies for the health endpoint
  • Restored original main.rs infrastructure (ServiceRegistry, ServiceDiscovery, MessageBroker) while integrating init_startup_time() call
  • Restored original lib.rs with all modules + added pub mod health
  • Health endpoint implementation in health.rs is clean and complete

Build and tests should now pass. This PR is ready for review and merge.

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.

Bounty #326: Health Endpoint Details

1 participant