feat: add Spring Boot Actuator health indicators for Mirror Node and Operator Balance#152
Open
Aamir377300 wants to merge 2 commits into
Open
Conversation
4baf52e to
2184aec
Compare
…Operator Balance Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
629288f to
73990da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pr is solve #146
Description
This PR adds Spring Boot Actuator health indicators to improve the observability of Hiero-based Spring applications and introduces basic health indicators so applications can expose this information through the standard Actuator health endpoint.
While working with the Spring integration, I noticed there was no built-in way to monitor important runtime dependencies such as:
Changes Included
MirrorNodeHealthIndicator
Adds a lightweight connectivity check for the configured Mirror Node REST API to verify that it is reachable and responding correctly.
OperatorBalanceHealthIndicator
Checks the configured operator account balance and compares it against a configurable minimum threshold. If the balance becomes too low, the health details will expose a warning so teams can detect the issue earlier before transactions begin failing.
Configuration Support
Added configuration properties under:
Auto Configuration
Introduced HieroHealthAutoConfiguration so the health indicators are automatically registered when Spring Boot Actuator is available on the classpath.
Dependency Update
Added spring-boot-starter-actuator as an optional dependency in the hiero-enterprise-spring module.
Verification
Verified successfully with:
Also verified the auto-configuration registration through HieroAutoConfiguration.
Edit:
Testing & Verification
To make sure the new health indicators behave correctly in different scenarios, I also added a dedicated unit test suite:
HealthIndicatorTest.javaTest Coverage
The tests currently cover:
I also standardized the health detail response keys across both indicators during testing so the JSON output remains more consistent for monitoring tools and dashboards.
Verified successfully with:
All tests are passing successfully.
Please review this pr @Ndacyayisenga-droid and I’d really appreciate feedback on the approach.