Skip to content

Log health contributor statuses when Eureka health status changes - #4592

Merged
ryanjbaxter merged 2 commits into
spring-cloud:mainfrom
yashdotdev13:issue-4135-log-health-contributor-status
Sep 2, 2026
Merged

ryanjbaxter merged 2 commits into
spring-cloud:mainfrom
yashdotdev13:issue-4135-log-health-contributor-status

Conversation

@yashdotdev13

Copy link
Copy Markdown
Contributor

Summary

Adds logging of individual health contributor statuses when the aggregated Eureka health status changes.

The health check handler now collects contributor names and their corresponding statuses while evaluating blocking and reactive health contributors. The collected statuses are included in the log message together with the resulting Eureka InstanceStatus.

Composite blocking and reactive health contributors continue to be traversed recursively, with their individual contributor names preserved.

Changes

  • Collect health contributor statuses by name during health evaluation.
  • Log the resulting Eureka health status together with contributor statuses when the status differs from the current InstanceStatus.
  • Preserve the existing status aggregation behavior by aggregating the collected statuses.
  • Add test coverage for named blocking health indicators.
  • Add test coverage for named reactive health indicators.

Testing

./mvnw.cmd -pl spring-cloud-netflix-eureka-client -DskipTests compile
./mvnw.cmd -pl spring-cloud-netflix-eureka-client -Dtest=EurekaHealthCheckHandlerTests test

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@ryanjbaxter

Copy link
Copy Markdown
Contributor

Why are you still aggregating status then in the other methods?

@yashdotdev13

yashdotdev13 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

The aggregation in getStatus is still required to determine the overall Eureka health status via StatusAggregator. The change only moves logging of each contributor's individual status into processContributor; the aggregated result remains necessary for computing the final overall status.

Signed-off-by: 98001yash <yashchauhan.gaya@gmail.com>
@yashdotdev13
yashdotdev13 force-pushed the issue-4135-log-health-contributor-status branch from 0e6f460 to c9d9905 Compare September 2, 2026 20:49
@github-project-automation github-project-automation Bot moved this to Todo in 2025.1.4 Sep 2, 2026
@ryanjbaxter ryanjbaxter added this to the 5.0.3 milestone Sep 2, 2026
@ryanjbaxter
ryanjbaxter merged commit 3b6ba97 into spring-cloud:main Sep 2, 2026
2 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2025.1.4 Sep 2, 2026
@github-project-automation github-project-automation Bot moved this from Todo to Done in 2026.0.0-M1 Sep 2, 2026
ryanjbaxter added a commit that referenced this pull request Sep 2, 2026
…ributor-status

Log health contributor statuses when Eureka health status changes
@ryanjbaxter

Copy link
Copy Markdown
Contributor

Cherry picked into 5.0.x as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants