Skip to content

feat: add Spring Boot Actuator health indicators for Mirror Node and Operator Balance#152

Open
Aamir377300 wants to merge 2 commits into
hiero-ledger:mainfrom
Aamir377300:feat/add-actuator-health-indicators
Open

feat: add Spring Boot Actuator health indicators for Mirror Node and Operator Balance#152
Aamir377300 wants to merge 2 commits into
hiero-ledger:mainfrom
Aamir377300:feat/add-actuator-health-indicators

Conversation

@Aamir377300

@Aamir377300 Aamir377300 commented May 8, 2026

Copy link
Copy Markdown
Contributor

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:

  • Mirror Node connectivity
  • operator account balance health

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:

spring.hiero.health.enabled=true
spring.hiero.health.min-balance-in-hbar=10

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:

./mvnw clean compile

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.java

Test Coverage

The tests currently cover:

  • successful health checks when the Mirror Node is reachable and the operator balance is healthy
  • connectivity failure scenarios by mocking network/API exceptions
  • low balance threshold handling
  • failures while fetching account balance information

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:

./mvnw test -pl hiero-enterprise-spring -Dtest=HealthIndicatorTest

All tests are passing successfully.

Please review this pr @Ndacyayisenga-droid and I’d really appreciate feedback on the approach.

@Aamir377300 Aamir377300 force-pushed the feat/add-actuator-health-indicators branch from 4baf52e to 2184aec Compare May 8, 2026 04:06
…Operator Balance

Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
@Aamir377300 Aamir377300 force-pushed the feat/add-actuator-health-indicators branch from 629288f to 73990da Compare May 8, 2026 04:11
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.

1 participant