Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add deep health check for drainer #3396

Merged
merged 20 commits into from
Feb 2, 2024

Conversation

Chethan-rao
Copy link
Contributor

@Chethan-rao Chethan-rao commented Jan 18, 2024

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates
  • Documentation
  • CI/CD

Description

This PR adds support for performing a deeper health check of the drainer which includes:

Database connection check with read, write and delete queries (Added support for database transaction too)
Redis connection check with set, get and delete key (Set key with expiry of 30sec)

The deep health check API returns a 200 status code if all the components are in good health, but returns 500 if at least one component's health is down

Additional Changes

  • This PR modifies the API contract
  • This PR modifies the database schema
  • This PR modifies application configuration/environment variables

Motivation and Context

How did you test it?

  1. /health

image

  1. /health/deep_check

image

THIS CANNOT BE TESTED ON SANBOX AS THE ENDPOINT IS NOT EXPOSED

Checklist

  • I formatted the code cargo +nightly fmt --all
  • I addressed lints thrown by cargo clippy
  • I reviewed the submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

@Chethan-rao Chethan-rao added C-feature Category: Feature request or enhancement S-waiting-on-review Status: This PR has been implemented and needs to be reviewed labels Jan 18, 2024
@Chethan-rao Chethan-rao self-assigned this Jan 18, 2024
@Chethan-rao Chethan-rao requested a review from a team as a code owner January 18, 2024 18:14
@Chethan-rao Chethan-rao linked an issue Jan 18, 2024 that may be closed by this pull request
2 tasks
dracarys18
dracarys18 previously approved these changes Feb 2, 2024
dracarys18
dracarys18 previously approved these changes Feb 2, 2024
crates/drainer/src/health_check.rs Outdated Show resolved Hide resolved
crates/drainer/src/main.rs Outdated Show resolved Hide resolved
@Gnanasundari24 Gnanasundari24 added this pull request to the merge queue Feb 2, 2024
Merged via the queue into main with commit 63c383f Feb 2, 2024
16 of 18 checks passed
@Gnanasundari24 Gnanasundari24 deleted the deep-health-check-for-drainer branch February 2, 2024 11:13
@SanchithHegde SanchithHegde removed the S-waiting-on-review Status: This PR has been implemented and needs to be reviewed label Feb 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-feature Category: Feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deep health check for Hyperswitch Drainer
4 participants